From c2c794a02bb847f75390d6ca9bfa3441853890ab Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 11 May 2018 11:27:26 -0300 Subject: [PATCH] Bug 17247: Do not return "debarred" if borrowernumber is invalid exception must be thrown instead --- C4/Reserves.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 3a9e6cc721..329feff1a8 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -308,11 +308,11 @@ sub CanItemBeReserved { my $item = GetItem($itemnumber); my $biblio = Koha::Biblios->find( $item->{biblionumber} ); my $patron = Koha::Patrons->find( $borrowernumber ); - if( !$patron || $patron->is_debarred ) { - return 'debarred'; - } my $borrower = $patron->unblessed; + return 'debarred' + if $patron->is_debarred; + # If an item is damaged and we don't allow holds on damaged items, we can stop right here return 'damaged' if ( $item->{damaged} -- 2.11.0