From e44d9639164f6dc9e8d20b6adf136237420e5401 Mon Sep 17 00:00:00 2001 From: Kyle Hall Date: Fri, 16 Sep 2022 10:57:53 -0400 Subject: [PATCH] Bug 31576: Cannot place hold even when AllowHoldPolicyOverride should allow it This bug appears in Koha 21.11 only ( behavior changes to bug 31575 with 22.05 and later ). If only some item holds can be forced, but others cannot ( because they have to pickup locations ), the place holds button remains disabled even though the hold can be placed. Test Plan: 1) Set one circ rule to allow 0 holds 2) For Library A, set "Hold pickup library match" to "item's hold group" 3) Enable AllowHoldPolicyOverride 4) Set ReservesControlBranch to "item's home branch" 5) Create a record with an item for Library A, one for Library B, and one for Library C This should create a scenario where A's item cannot be held, and B and C's items must be overridden 6) Note you cannot place the hold because the button is disabled. 7) Apply this patch 8) Restart all the things! 9) Reload the page, the place hold button should now be enabled! Signed-off-by: David Nind --- reserve/request.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reserve/request.pl b/reserve/request.pl index 36daf35dcd..c97016935f 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -659,7 +659,7 @@ if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) # While we can't override an alreay held item, we should be able to override the others # Unless all items are already held - if ( $num_override > 0 && ($num_override + $num_alreadyheld) == scalar( @{ $biblioitem->{itemloop} } ) ) { + if ( $num_override > 0 && $num_alreadyheld < scalar @{ $biblioitem->{itemloop} } ) { # That is, if all items require an override $template->param( override_required => 1 ); } elsif ( $num_items_available == 0 ) { -- 2.30.2