From 85a58e6f62a7b5a4eedcebb5e77f6f9776734780 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 4 Dec 2019 16:04:45 +0100 Subject: [PATCH] Bug 24168: (bug 23116 follow-up) AllowHoldPolicyOverride allows a librarian to almost place a hold on an item already on hold This patch actually fixes the issue described on bug 23116. Test plan: See bug 23116 and comment 5. Important to note that the later comparison with itemAlreadyOnHold assumes that the variable is a string. Signed-off-by: Marcel de Rooy Signed-off-by: Martin Renvoize Signed-off-by: Joy Nelson (cherry picked from commit c5336e24eb24c0faa7d28faa96bd40b13ccf834c) Signed-off-by: Lucas Gass --- reserve/request.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reserve/request.pl b/reserve/request.pl index 89368086cc..e80e77da4a 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -477,8 +477,8 @@ foreach my $biblionumber (@biblionumbers) { $item->{'holdallowed'} = $branchitemrule->{'holdallowed'}; - my $can_item_be_reserved = CanItemBeReserved( $patron->borrowernumber, $itemnumber, $pickup ); - $item->{not_holdable} = $can_item_be_reserved->{status} unless ( $can_item_be_reserved->{status} eq 'OK' ); + my $can_item_be_reserved = CanItemBeReserved( $patron->borrowernumber, $itemnumber, $pickup )->{status}; + $item->{not_holdable} = $can_item_be_reserved unless $can_item_be_reserved eq 'OK'; $item->{item_level_holds} = Koha::IssuingRules->get_opacitemholds_policy( { item => $item_object, patron => $patron } ); @@ -486,7 +486,7 @@ foreach my $biblionumber (@biblionumbers) { !$item->{cantreserve} && !$exceeded_maxreserves && IsAvailableForItemLevelRequest($item_object, $patron) - && $can_item_be_reserved->{status} eq 'OK' + && $can_item_be_reserved eq 'OK' ) { $item->{available} = 1; -- 2.39.5