@@ -, +, @@ 1 - Set a holds rule to allow on-shelf holds only if all unavailable 2 - Set AllowHoldPolicyOverride to 'Allow' 3 - Find a record with several items available 4 - Attempt to place a hold 5 - The items have a yellow triangle, but no pickup locations 6 - Place an item level hold 7 - Note the hold has no pickup location 8 - Cancel the hold 9 - Apply patch and restart all --- reserve/request.pl | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) --- a/reserve/request.pl +++ a/reserve/request.pl @@ -593,8 +593,20 @@ foreach my $biblionumber (@biblionumbers) { # If AllowHoldPolicyOverride is set, it should override EVERY restriction, not just branch item rules # with the exception of itemAlreadyOnHold because, you know, the item is already on hold if ( $can_item_be_reserved ne 'itemAlreadyOnHold' ) { - $item->{override} = 1; - $num_override++; + # Send the pickup locations count to the UI, the pickup locations will be pulled using the API + my $pickup_locations = $item_object->pickup_locations({ patron => $patron }); + $item->{pickup_locations_count} = $pickup_locations->count; + if ( $item->{pickup_locations_count} > 0 ) { + $item->{override} = 1; + $num_override++; + # pass the holding branch for use as default + my $default_pickup_location = $pickup_locations->search({ branchcode => $item->{holdingbranch} })->next; + $item->{default_pickup_location} = $default_pickup_location; + } + else { + $item->{available} = 0; + $item->{not_holdable} = "no_valid_pickup_location"; + } } else { $num_alreadyheld++ } push( @available_itemtypes, $item->{itype} ); --