Skip to content

Commit e1517fc

Browse files
Emily Lamancusakfischer
Emily Lamancusa
authored andcommitted
Bug 37587: Fix priority of multiple item-level holds
The rank parameter is passed per biblio record, not per item. When placing multiple item-level holds on one bib record, only $rank[0] is defined. To test: 1. System preference and circulation rule setup i. Set the system preference DisplayMultiItemHolds to Enable ii. Edit the default circulation rule to allow 5 holds per record 2. Find or create a bib with 4 or more items 3. Place several bib-level holds 4. Place 4 or more item-level holds at once on that same record i. Search for a patron to place the holds for (not one of the patrons you used in step 3) ii. Select "Hold a specific item" iii. Check the checkboxes for 4 or more items iv. Click Place hold --> Note that one of the new item-level holds is at the end of the list as it should be, but the rest are out of order 5. Cancel the item-level holds from step 4 6. Apply patch and restart_all 7. Repeat step 4 --> All the new item-level holds are now at the end of the list Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
1 parent 1264ece commit e1517fc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

reserve/placerequest.pl

+6-1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@
7373

7474
my $can_override = C4::Context->preference('AllowHoldPolicyOverride');
7575
if ( @checkitems ) {
76+
77+
my $hold_priority = $rank[0];
78+
7679
for ( my $i = 0 ; $i < scalar @checkitems ; $i++ ) {
7780
my $checkitem = $checkitems[$i];
7881
if ( my $item_pickup_location = $input->param("item_pickup_$checkitem") ) {
@@ -93,7 +96,7 @@
9396
branchcode => $item_pickup_location,
9497
borrowernumber => $patron->borrowernumber,
9598
biblionumber => $biblionumber,
96-
priority => $rank[$i],
99+
priority => $hold_priority,
97100
reservation_date => $startdate,
98101
expiration_date => $expirationdate,
99102
notes => $notes,
@@ -105,6 +108,8 @@
105108
}
106109
);
107110

111+
$hold_priority++;
112+
108113
} else {
109114
$failed_holds{$can_item_be_reserved} = 1;
110115
}

0 commit comments

Comments
 (0)