I get the following warnings in the log when receiving items under Plack: Variable "$datereceived" is not available at /home/jcamins/kohaclone/acqui/finishreceive.pl line 154. Variable "$unitprice" is not available at /home/jcamins/kohaclone/acqui/finishreceive.pl line 155. Variable "$rrp" is not available at /home/jcamins/kohaclone/acqui/finishreceive.pl line 156. Variable "$biblionumber" is not available at /home/jcamins/kohaclone/acqui/finishreceive.pl line 158.
Created attachment 22020 [details] [review] [PATCH] Bug 9224: Make acqui/finishreceive.pl Plack-compatible
Under Plack/mod_perl wrapping, sub update_item() will become a closure, so after the 1st run it will retain it's own private instances of the following variables: $booksellerid, $datereceived, $unitprice, $rrp, $biblionumber. I.e., in case update_item() gets invoked 2nd+ time (inside the same process, but for different-subsequent receives) it may incorrectly flag the (old, wrong) biblionumber for Zebra reindexing, and erronously modify the current item[s] with the previously used (wrong) values. This simple patch should make acqui/finishreceive.pl Plack-compatible. Test plan: Test patched acqui/finishreceive.pl script (create and receive some orders w/ items, etc.). Ensure items are gettting added and/or modified correctly during receiving process.
Patch applied cleanly, go forth and signoff
Created attachment 23216 [details] [review] Bug 9224: Make acqui/finishreceive.pl Plack-compatible Under Plack/mod_perl wrapping, sub update_item() will become a closure, so after the 1st run it will retain it's own private instances of the following variables: $booksellerid, $datereceived, $unitprice, $rrp, $biblionumber. I.e., in case update_item() gets invoked 2nd+ time (inside the same process, but for different-subsequent receives) it may incorrectly flag the (old, wrong) biblionumber for Zebra reindexing, and erronously modify the current item[s] with the previously used (wrong) values. This simple patch should make acqui/finishreceive.pl Plack-compatible. Test plan: Test patched acqui/finishreceive.pl script (create and receive some orders w/ items, etc.). Ensure items are gettting added and/or modified correctly during receiving process. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Created attachment 23533 [details] [review] Bug 9224: Make acqui/finishreceive.pl Plack-compatible Under Plack/mod_perl wrapping, sub update_item() will become a closure, so after the 1st run it will retain it's own private instances of the following variables: $booksellerid, $datereceived, $unitprice, $rrp, $biblionumber. I.e., in case update_item() gets invoked 2nd+ time (inside the same process, but for different-subsequent receives) it may incorrectly flag the (old, wrong) biblionumber for Zebra reindexing, and erronously modify the current item[s] with the previously used (wrong) values. This simple patch should make acqui/finishreceive.pl Plack-compatible. Test plan: Test patched acqui/finishreceive.pl script (create and receive some orders w/ items, etc.). Ensure items are gettting added and/or modified correctly during receiving process. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Passes koha-qa.pl, works as advertised, no regressions found.
Pushed to master. Thanks, Jacek! This appears to be the first patch of yours accepted into Koha. Congratulations!
Patch pushed to 3.14.x, will be in 3.14.2
This patch has been pushed to 3.12.x, will be in 3.12.9. Thanks Jacek!