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.
Created attachment 14692 [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.
Created attachment 15079 [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.
QA comment: Works with Plack and Apache. Marked as Passed QA.
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.
This patch has been pushed to master.
Pushed to 3.10.x will be in 3.10.3