From 1478980713d52ead3d48a8dbfebc738b83cbe97c 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 --- C4/Reserves.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 216ececdba..4fc8633a32 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -290,6 +290,7 @@ sub CanBookBeReserved{ cannotReserveFromOtherBranches, if syspref 'canreservefromotherbranches' is OK. tooManyReserves, if the borrower has exceeded his maximum reserve amount. notReservable, if holds on this item are not allowed + expired, if patron is expired and expired patrons are not allowed to place holds =cut @@ -308,6 +309,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 'damaged' if ( $item->{damaged} -- 2.14.2