Bug 9224: Make acqui/finishreceive.pl Plack-compatible
authorJacek Ablewicz <abl@biblos.pk.edu.pl>
Wed, 16 Oct 2013 15:31:04 +0000 (17:31 +0200)
committerFridolin SOMERS <fridolin.somers@biblibre.com>
Tue, 24 Dec 2013 12:55:47 +0000 (13:55 +0100)
commit2a38ac7259bbe88d1d531bfd9d93d9edee64a4c4
treed0a344251fbd371674823aa52898f5cc8f1753ad
parent9478f2875ad7d378d6ff32bbf1cc4475b30d242f
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 its 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.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 6dcc34c1b44f72a8602c4ee95540836e6cd1e7bd)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
acqui/finishreceive.pl