From 662de2a9552f49ce0cd1d435696dc8e2c3158c1e Mon Sep 17 00:00:00 2001 From: Andrew Fuerste Henry Date: Fri, 1 May 2026 14:52:14 +0000 Subject: [PATCH] Bug 42490: Implement LocalHoldsPriorityScope To test: 1 - Set LocalHoldsPriority to "Don't give", set HoldsQueuePrioritizeBranch to "home library" 2 - have a bib with two items: both items available, Item 1 home and holdingbranch Centerville, Item 2 home and holdingbranch Fairfield 3 - place a hold (Hold 1) on the bib for a patron from Centerville , for pickup at Fairfield 4 - place a hold (Hold 2) on the bib for a patron from Fairfield, for pickup at Centerville Establish behavior without LocalHoldsPriority 5 - build holds queue 6 - confirm the queue targets the FPL item for Hold 1 and the CPL item for Hold 2 7 - check both items out to a third patron (not one of your patrons with holds) 8 - check in Item 2, confirm it tries to fill Hold 1, click Ignore 9 - check in Item 1, confirm it also tries to fill Holds 1, click Ignore 10 - reset item locations: UPDATE items SET holdingbranch=homebranch; Establish behavior with LocalHoldsPriority 11 - Set LocalHoldsPriority to "Give library", LocalHoldsPriorityPatronControl to "home library", LocalHoldsPriorityItemControl to "home library" 12 - build holds queue 13 - confirm the queue targets the CPL item for Hold 1 and the FPL item for Hold 2 14 - check both items out to a third patron (not one of your patrons with holds) 15 - build holds queue, confirm it has no targets 16 - check in Item 2, confirm it tries to fill Hold 2, click Ignore 17 - check in Item 1, confirm it tries to fill Holds 1, click Ignore 18 - reset item locations: UPDATE items SET holdingbranch=homebranch; Apply patch, updatedatabase, restart_all 19 - confirm new system preference LocalHoldsPriorityScope, set to "checking items in and building the holds queue" 20 - repeat steps 11 - 18, no change in behavior 21 - set LocalHoldsPriorityScope to "checking items in" 22 - build holds queue 23 - confirm the queue targets the FPL item for Hold 1 and the CPL item for Hold 2 24 - check both items out to a third patron (not one of your patrons with holds) 25 - build holds queue, confirm it has no targets 26 - check in Item 2, confirm it tries to fill Hold 2 27 - check in Item 1, confirm it tries to fill Holds 1 Sponsored-by: The Main Library Alliance Signed-off-by: Trevor Diamond Signed-off-by: Martin Renvoize Signed-off-by: Pedro Amorim --- C4/HoldsQueue.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm index 1962a8e7aa..4fb2bab26b 100644 --- a/C4/HoldsQueue.pm +++ b/C4/HoldsQueue.pm @@ -760,8 +760,9 @@ sub MapItemsToHoldRequests { # Look for Local Holds Priority matches first - my $LocalHoldsPriority = C4::Context->preference('LocalHoldsPriority'); - if ( $LocalHoldsPriority ne 'None' ) { + my $LocalHoldsPriority = C4::Context->preference('LocalHoldsPriority'); + my $LocalHoldsPriorityScope = C4::Context->preference('LocalHoldsPriorityScope'); + if ( $LocalHoldsPriority ne 'None' && $LocalHoldsPriorityScope eq 'checkin_and_queue' ) { my $LocalHoldsPriorityPatronControl = C4::Context->preference('LocalHoldsPriorityPatronControl'); my $LocalHoldsPriorityItemControl = C4::Context->preference('LocalHoldsPriorityItemControl'); foreach my $request (@$hold_requests) {