The patron image tool can correctly process images, however, the variables needed for returning results are global and broken (the script itself documents this issue) and plack errors out when trying to access them. The results now are limited to 'success' for a 100% successful file and 'failed' when there is an error logs: Variable "@counts" is not available at /home/vagrant/kohaclone/tools/picture-upload.pl line 228. Variable "$filetype" is not available at /home/vagrant/kohaclone/tools/picture-upload.pl line 240. Variable "$uploadfilename" is not available at /home/vagrant/kohaclone/tools/picture-upload.pl line 241.
Created attachment 53234 [details] [review] Bug 16886: Make the 'Upload patron images' tool plack safe Some vars are accessed from subroutine, but defined with my. It causes at least the 2 followings errors: Variable "$filetype" is not available at /home/koha/src/tools/picture-upload.pl line 240. Variable "$uploadfilename" is not available at /home/koha/src/tools/picture-upload.pl line 241. To avoid that, they are now declared with our. Test plan: Upload image for a patron and confirm that you get a "Result" table and the errors do not longer appear in the logs.
Created attachment 53264 [details] [review] Bug 16886: Make the 'Upload patron images' tool plack safe Some vars are accessed from subroutine, but defined with my. It causes at least the 2 followings errors: Variable "$filetype" is not available at /home/koha/src/tools/picture-upload.pl line 240. Variable "$uploadfilename" is not available at /home/koha/src/tools/picture-upload.pl line 241. To avoid that, they are now declared with our. Test plan: Upload image for a patron and confirm that you get a "Result" table and the errors do not longer appear in the logs. Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 54664 [details] [review] [PASSED QA] Bug 16886: Make the 'Upload patron images' tool plack safe Some vars are accessed from subroutine, but defined with my. It causes at least the 2 followings errors: Variable "$filetype" is not available at /home/koha/src/tools/picture-upload.pl line 240. Variable "$uploadfilename" is not available at /home/koha/src/tools/picture-upload.pl line 241. To avoid that, they are now declared with our. Test plan: Upload image for a patron and confirm that you get a "Result" table and the errors do not longer appear in the logs. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Pushed to master for 16.11, thanks Jonathan!
Pushed in 16.05. Will be in 16.05.04.
Pushed to 3.22.x, will be in 3.22.11