Bug 17294 - reserves_stats.pl is not plack safe
Summary: reserves_stats.pl is not plack safe
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Target Milestone: ---
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 7172 17253
  Show dependency treegraph
 
Reported: 2016-09-13 08:42 UTC by Jonathan Druart
Modified: 2017-12-07 22:17 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 17294: Make reserves_stats.pl plack safe (2.22 KB, patch)
2016-09-13 08:47 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17294: Make reserves_stats.pl plack safe (2.22 KB, patch)
2016-09-13 08:49 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17294: Make reserves_stats.pl plack safe (2.35 KB, patch)
2016-09-16 16:52 UTC, Marc Véron
Details | Diff | Splinter Review
[PASSED QA] Bug 17294: Make reserves_stats.pl plack safe (2.42 KB, patch)
2016-09-25 16:51 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2016-09-13 08:42:47 UTC
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.
Comment 1 Jonathan Druart 2016-09-13 08:47:07 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2016-09-13 08:49:52 UTC
Created attachment 55518 [details] [review]
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.
Comment 3 Marc Véron 2016-09-16 16:52:24 UTC
Created attachment 55626 [details] [review]
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.

Signed-off-by: Marc Véron <veron@veron.ch>
Comment 4 Katrin Fischer 2016-09-18 12:44:40 UTC
Hm, something wrong with Plack in my kohadevbox :(
Comment 5 Katrin Fischer 2016-09-25 16:50:17 UTC
Figured out my kohadevbox problem, was able to test this now.
Comment 6 Katrin Fischer 2016-09-25 16:51:18 UTC
Created attachment 55804 [details] [review]
[PASSED QA] 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.

Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>
Comment 7 Kyle M Hall 2016-09-27 11:08:29 UTC
Pushed to master for 16.11, thanks Jonathan!
Comment 8 Frédéric Demians 2016-09-30 08:37:35 UTC
Pushed in 16.05. Will be in 16.05.05.
Comment 9 Julian Maurice 2016-10-14 11:53:24 UTC
Pushed to 3.22.x, will be in 3.22.12