Bug 9421

Summary: tools/picture-upload.pl not Plack-compatible
Product: Koha Reporter: Jared Camins-Esakov <jcamins>
Component: ToolsAssignee: Jared Camins-Esakov <jcamins>
Status: CLOSED FIXED QA Contact: Jonathan Druart <jonathan.druart+koha>
Severity: major    
Priority: P5 - low CC: chris, jonathan.druart+koha, mirko
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 9421: tools/picture-upload.pl not Plack-compatible
Bug 9421: tools/picture-upload.pl not Plack-compatible
Bug 9421: tools/picture-upload.pl not Plack-compatible

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