From b8de520952b205d94f97de6ad2d9b94346475a81 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 17 Jun 2020 11:41:21 -0400 Subject: [PATCH] Bug 25783: Holds Queue treating item-level holds as bib-level The holds queue builder does not honor the new item_level_hold flag. Instead, it only item_level_request if in the loop dealing with item level holds. This is incorrect. Item level holds may be trapped in the local holds priority loop as well. It's trivial to just pass though the correct item/biblio level hold flag. I do not know how to write a reproducable test plan for these issues. Signed-off-by: Tomas Cohen Arazi Signed-off-by: Kim Peine Signed-off-by: Jonathan Druart (cherry picked from commit db235d33a4caf64387b86ebab7b658bd7759ff21) (cherry picked from commit aa4eba6d232fd5009312286f5e3575c4ca25e9f3) Signed-off-by: Aleisha Amohia --- C4/HoldsQueue.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm index 5f2c2c556c..18a9063e53 100755 --- a/C4/HoldsQueue.pm +++ b/C4/HoldsQueue.pm @@ -277,7 +277,7 @@ sub GetPendingHoldRequestsForBib { my $dbh = C4::Context->dbh; my $request_query = "SELECT biblionumber, borrowernumber, itemnumber, priority, reserves.branchcode, - reservedate, reservenotes, borrowers.branchcode AS borrowerbranch, itemtype + reservedate, reservenotes, borrowers.branchcode AS borrowerbranch, itemtype, item_level_hold FROM reserves JOIN borrowers USING (borrowernumber) WHERE biblionumber = ? @@ -436,7 +436,7 @@ sub MapItemsToHoldRequests { holdingbranch => $item->{holdingbranch}, pickup_branch => $request->{branchcode} || $request->{borrowerbranch}, - item_level => 0, + item_level => $request->{item_level_hold}, reservedate => $request->{reservedate}, reservenotes => $request->{reservenotes}, }; @@ -475,7 +475,7 @@ sub MapItemsToHoldRequests { biblionumber => $request->{biblionumber}, holdingbranch => $items_by_itemnumber{ $request->{itemnumber} }->{holdingbranch}, pickup_branch => $request->{branchcode} || $request->{borrowerbranch}, - item_level => 1, + item_level => $request->{item_level_hold}, reservedate => $request->{reservedate}, reservenotes => $request->{reservenotes}, }; @@ -650,7 +650,7 @@ sub MapItemsToHoldRequests { biblionumber => $request->{biblionumber}, holdingbranch => $holdingbranch, pickup_branch => $pickup_branch, - item_level => 0, + item_level => $request->{item_level_hold}, reservedate => $request->{reservedate}, reservenotes => $request->{reservenotes}, }; -- 2.39.5