From 858ab5ed5649c894247aa6a96c5aa9ba0593eb90 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Wed, 31 Aug 2016 15:27:44 +0200 Subject: [PATCH] Bug 17229: Check if patron is expired in CanItemBeReserved This way, calls to ILS-DI HoldTitle and HoldItem do this check too Signed-off-by: Brendan Gallagher --- C4/Reserves.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 974168f8a3..c413531eb1 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -306,6 +306,7 @@ sub CanBookBeReserved{ { status => libraryNotFound }, if given branchcode is not an existing library { status => libraryNotPickupLocation }, if given branchcode is not configured to be a pickup location { status => cannotBeTransferred }, if branch transfer limit applies on given item and branchcode + { status => patronExpired } if patron is expired and expired patrons are not allowed to place holds =cut @@ -325,6 +326,10 @@ sub CanItemBeReserved { my $patron = Koha::Patrons->find( $borrowernumber ); my $borrower = $patron->unblessed; + if ($patron->category->effective_BlockExpiredPatronOpacActions && $patron->is_expired) { + return 'expired'; + } + # If an item is damaged and we don't allow holds on damaged items, we can stop right here return { status =>'damaged' } if ( $item->{damaged} -- 2.13.7