Bug 25786: Holds Queue building may target the wrong item for item level requests...
authorKyle M Hall <kyle@bywatersolutions.com>
Wed, 17 Jun 2020 16:53:36 +0000 (12:53 -0400)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 18 Jun 2020 16:53:42 +0000 (18:53 +0200)
commitc6a1277fdb84df93be2cfa5cb0fa47c950116c20
treeae96b04e0629629ec1c2650ef22583296312eb7f
parentaa4eba6d232fd5009312286f5e3575c4ca25e9f3
Bug 25786: Holds Queue building may target the wrong item for item level requests that match holds queue priority

Bug 23934 removed the limitation that prevented item level holds from
getting local holds priority. The problem is the code has never checked
if the item level hold matches the given item! This means the wrong item
may be requested to fill an item level hold.

Test Plan:
1) Create 3 items on a record
2) Place a hold for the 2nd item you created
4) Ensure that hold would be picked up by local holds priority
5) Build the holds queue
6) Note the holds queue is asking for the wrong item!
7) Apply this patch
8) Rebuild the holds queue
9) Holds queue should now be asking for the correct item!

Signed-off-by: Kim Peine <kim@williston.lib.vt.us>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b17a04dd077bb118086ad9e4bb58eee81ade2cdd)
C4/HoldsQueue.pm
t/db_dependent/HoldsQueue.t