Bug 9421 - tools/picture-upload.pl not Plack-compatible
Summary: tools/picture-upload.pl not Plack-compatible
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Jared Camins-Esakov
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-18 02:17 UTC by Jared Camins-Esakov
Modified: 2014-05-26 21:05 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 9421: tools/picture-upload.pl not Plack-compatible (3.17 KB, patch)
2013-01-18 02:47 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review
Bug 9421: tools/picture-upload.pl not Plack-compatible (3.28 KB, patch)
2013-02-05 21:16 UTC, Mirko Tietgen
Details | Diff | Splinter Review
Bug 9421: tools/picture-upload.pl not Plack-compatible (3.28 KB, patch)
2013-02-06 15:07 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jared Camins-Esakov 2013-01-18 02:17:07 UTC
I get the following error when I try to upload a patron image:
Can't call method "param" on an undefined value at /home/jcamins/kohaclone/tools/picture-upload.pl line 300, <fh00001jcamins_headshot.jpg> line 79.
 at /home/jcamins/kohaclone/tools/picture-upload.pl line 316

This happens because $template is not available in the subroutines in that file.
Comment 1 Jared Camins-Esakov 2013-01-18 02:47:49 UTC Comment hidden (obsolete)
Comment 2 Mirko Tietgen 2013-02-05 21:16:48 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2013-02-06 15:07:43 UTC
QA comment:
Works with Plack and Apache.
Marked as Passed QA.
Comment 4 Jonathan Druart 2013-02-06 15:07:55 UTC
Created attachment 15103 [details] [review]
Bug 9421: tools/picture-upload.pl not Plack-compatible

This patch avoids using file-level private variables in subroutines
by passing the needed variables as parameters to the subroutines.

To test (under Plack):
1) Try uploading a patron image without applying the patch. Notice
   it fails.
2) Apply patch.
3) Try uploading a patron image again, noticing this time it succeeds.

To test (under Apache):
1) Apply patch.
2) Try uploading a patron image, confirm that it works.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Fixes Plack, does not break Apache. Works as expected.
Comment 5 Jared Camins-Esakov 2013-02-06 17:36:06 UTC
This patch has been pushed to master.
Comment 6 Chris Cormack 2013-02-08 23:23:34 UTC
Pushed to 3.10.x will be in 3.10.3