Bugzilla – Attachment 55518 Details for
Bug 17294
reserves_stats.pl is not plack safe
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17294: Make reserves_stats.pl plack safe
Bug-17294-Make-reservesstatspl-plack-safe.patch (text/plain), 2.22 KB, created by
Jonathan Druart
on 2016-09-13 08:49:52 UTC
(
hide
)
Description:
Bug 17294: Make reserves_stats.pl plack safe
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-09-13 08:49:52 UTC
Size:
2.22 KB
patch
obsolete
>From e71aa9d5c0d938cefe90b293a9b766edd26aae68 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 13 Sep 2016 09:44:41 +0100 >Subject: [PATCH] Bug 17294: Make reserves_stats.pl plack safe > >Lot of errors are raised by this script under plack because of var scope >issues: > >Variable "$ccodes" is not available at >/home/koha/src/reports/reserves_stats.pl line 337. >Variable "$locations" is not available at >/home/koha/src/reports/reserves_stats.pl line 338. >Variable "$itemtypes" is not available at >/home/koha/src/reports/reserves_stats.pl line 339. >Variable "$Bsort1" is not available at >/home/koha/src/reports/reserves_stats.pl line 344. >Variable "$Bsort2" is not available at >/home/koha/src/reports/reserves_stats.pl line 350. >Variable "@patron_categories" is not available at >/home/koha/src/reports/reserves_stats.pl line 356. > >The lazy way to fix that is that reinit them from the subroutines they >are used. > >Test plan: >Execute the report, after this patch applied you won't see the error in >the log. >--- > reports/reserves_stats.pl | 7 +++++++ > 1 file changed, 7 insertions(+) > >diff --git a/reports/reserves_stats.pl b/reports/reserves_stats.pl >index 40a231d..f4d19e7 100755 >--- a/reports/reserves_stats.pl >+++ b/reports/reserves_stats.pl >@@ -333,6 +333,12 @@ sub null_to_zzempty ($) { > } > sub display_value { > my ( $crit, $value ) = @_; >+ my $ccodes = GetKohaAuthorisedValues("items.ccode"); >+ my $locations = GetKohaAuthorisedValues("items.location"); >+ my $itemtypes = GetItemTypes(); >+ my $authvalue = GetKohaAuthorisedValues("items.authvalue"); >+ my $Bsort1 = GetAuthorisedValues("Bsort1"); >+ my $Bsort2 = GetAuthorisedValues("Bsort2"); > my $display_value = > ( $crit =~ /ccode/ ) ? $ccodes->{$value} > : ( $crit =~ /location/ ) ? $locations->{$value} >@@ -353,6 +359,7 @@ sub display_value { > } > } > elsif ( $crit =~ /category/ ) { >+ my @patron_categories = Koha::Patron::Categories->search_limited({}, {order_by => ['description']}); > foreach my $patron_category ( @patron_categories ) { > ( $value eq $patron_category->categorycode ) or next; > $display_value = $patron_category->description and last; >-- >2.8.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17294
:
55516
|
55518
|
55626
|
55804