From b37d6989e5f28e820c014cb3262d3ce3a795b20c Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 2 Sep 2026 12:25:20 +0000 Subject: [PATCH] Bug 43448: Remove meaningless conditional We are in a conditional based on AllowHoldPolicyOverride being enabled, a second conditional with an OR on the value will always be true To test: 1 - Do not apply patch 2 - Disable AllowHoldPolicyOverride 3 - Create a biblio B with an item I at library A. 4 - Configure this library A to not be a pickup location 5 - Add a "Default holds policy by item type" for item I type where "Hold pickup library match" is "item's home library" 6 - Try to place a hold on biblio B You should not be able to place a hold because there is no valid pickup locations 7 - Enable AllowHoldPolicyOverride 8 - Try to place a hold on biblio B You should now see all valid pickup locations in a dropdown list (with an exclamation mark in front of each option) with none selected by default 9 - Verify you can place a title-level hold and an item-level hold 10 - Apply patch, repeat test plan, verify nothing has changed Signed-off-by: David Nind Signed-off-by: Matt Blenkinsop Signed-off-by: Pedro Amorim --- reserve/request.pl | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/reserve/request.pl b/reserve/request.pl index 81ebca8724..4eabdb6e08 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -607,21 +607,16 @@ if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) my @pickup_locations = $item_object->pickup_locations( { patron => $patron } )->as_list; $item->{pickup_locations_count} = scalar @pickup_locations; - if ( @pickup_locations || C4::Context->preference('AllowHoldPolicyOverride') ) { - $num_items_available++; - $item->{override} = 1; - $num_override++; + $num_items_available++; + $item->{override} = 1; + $num_override++; - my $default_pickup_location; + my $default_pickup_location; - ($default_pickup_location) = - grep { $_->branchcode eq $default_pickup_branch } @pickup_locations; + ($default_pickup_location) = + grep { $_->branchcode eq $default_pickup_branch } @pickup_locations; - $item->{default_pickup_location} = $default_pickup_location; - } else { - $item->{available} = 0; - $item->{not_holdable} = "no_valid_pickup_location"; - } + $item->{default_pickup_location} = $default_pickup_location; } else { $num_alreadyheld++; }