From 59b6a609e700ab2e373b2b0283950b6dcb37cb27 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Tue, 5 Mar 2024 17:09:28 +0000 Subject: [PATCH] Bug 36197: Unauthenticated patron can always place ILL request if ILLOpacUnauthenticatedRequest Signed-off-by: David Nind --- Koha/ILL/Request.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Koha/ILL/Request.pm b/Koha/ILL/Request.pm index e71255e398..61d2a27f95 100644 --- a/Koha/ILL/Request.pm +++ b/Koha/ILL/Request.pm @@ -2134,8 +2134,11 @@ Patron object sub can_patron_place_ill_in_opac { my ( $self, $patron ) = @_; + return 1 if C4::Context->preference('ILLOpacUnauthenticatedRequest') && !$patron; + return 0 - unless $patron->_result->categorycode->can_place_ill_in_opac + unless $patron + && $patron->_result->categorycode->can_place_ill_in_opac && !( $patron->is_expired && $patron->category->effective_BlockExpiredPatronOpacActions_contains('ill_request') ); return 1; -- 2.39.5