From b73023cfea37129ba2acccb11fa71fc014c1671a 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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index afdcb48..c72e5db 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -456,6 +456,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 @@ -470,7 +471,11 @@ sub CanItemBeReserved{ # item->{itype} will come for biblioitems if necessery my $item = GetItem($itemnumber); my $biblioData = C4::Biblio::GetBiblioData( $item->{biblionumber} ); - my $borrower = C4::Members::GetMember('borrowernumber'=>$borrowernumber); + my $borrower = C4::Members::GetMemberDetails($borrowernumber); + + if ($borrower->{BlockExpiredPatronOpacActions} && $borrower->{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} && !C4::Context->preference('AllowHoldsOnDamagedItems') ); -- 2.1.4