From bc0c687ca5e20447ff72917cf1c2734f580ac7a2 Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Wed, 24 Jul 2019 11:33:48 +0000 Subject: [PATCH] Bug 22806: (follow-up) CanBookBeReserved and CanItemBeReserved must check AllowHoldsOnPatronsPossessions As CanBookBeReserved() was failing as $patron and and $biblio were not instantiated I fixed that up. Test plan : 1 - set AllowHoldsOnPatronsPossessions to "Don't Allow" 2 - Checkout an item to a borrower 3 - Try to reserve an item using ILS-DI WebService -> Will work without complaining. 4 - Cancel the hold and apply patch 5 - Repeat 3 -> Should not place hold and show error "NotHoldable" Sponsored-By: Catalyst IT Signed-off-by: Laurence Rault Signed-off-by: David Nind Signed-off-by: David Nind Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart --- C4/Reserves.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 8ad4e5178f..4827928c24 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -320,7 +320,7 @@ sub CanBookBeReserved{ # Check that patron have not checked out this biblio (if AllowHoldsOnPatronsPossessions set) if ( !C4::Context->preference('AllowHoldsOnPatronsPossessions') - && C4::Circulation::CheckIfIssuedToPatron( $patron->borrowernumber, $biblio->biblionumber ) ) { + && C4::Circulation::CheckIfIssuedToPatron( $borrowernumber, $biblionumber ) ) { return { status =>'itemAlreadyOnLoan' }; } -- 2.39.5