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 <tomascohen@theke.io>

Signed-off-by: Kim Peine <kim@williston.lib.vt.us>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Kyle Hall 2020-06-17 11:41:21 -04:00 committed by Jonathan Druart
parent dd4970860d
commit db235d33a4

View file

@ -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},
};