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.
Created attachment 105981 [details] [review] 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!
Created attachment 105994 [details] [review] 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>
The tests are failing for me # Failed test 'No tests run for subtest "Test Local Holds Priority - Get correct item for item level hold"' # at t/db_dependent/HoldsQueue.t line 1163. Can't use string ("KpHbPJqfr8") as a HASH ref while "strict refs" in use at /kohadevbox/koha/C4/Reserves.pm line 176. # Looks like your test exited with 255 just after 50.
Created attachment 106010 [details] [review] Bug 25786: AddReserve now takes a hashref
Created attachment 106023 [details] [review] 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>
Created attachment 106024 [details] [review] Bug 25786: AddReserve now takes a hashref Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Aleisha: The second patch should not be applied to 19.11.
Pushed to master for 20.11, thanks to everybody involved!
backported to 20.05.x for 20.05.01
can backport once the tests are fixed on Bug 25783
(In reply to Aleisha Amohia from comment #10) > can backport once the tests are fixed on Bug 25783 Hi Alicia, Kyle fixed the tests on 25783 - can you test?
backported to 19.11.x for 19.11.10 (first patch only) - Aleisha
Missing dependencies for 19.05.x, can't backport.