From 507dd25f480685ca596826464dd8993787236e3b Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Tue, 5 Mar 2024 17:07:01 +0000 Subject: [PATCH] Bug 36197: Only check limits for regular requests Skip for unauthenticated requests Signed-off-by: David Nind Signed-off-by: Tomas Cohen Arazi --- Koha/ILL/Request.pm | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Koha/ILL/Request.pm b/Koha/ILL/Request.pm index c57400cb03f..26be3cbb2c6 100644 --- a/Koha/ILL/Request.pm +++ b/Koha/ILL/Request.pm @@ -1094,16 +1094,12 @@ sub backend_create { # ... complex case: commit! # Do we still have space for an ILL or should we queue? - my $permitted = $self->check_limits( { patron => $self->patron }, { librarycode => $self->branchcode } ); - - # Now augment our committed request. - - $result->{permitted} = $permitted; # Queue request? - - # This involves... - - # ...Updating status! - $self->status('QUEUED')->store unless ($permitted); + my $permitted = 1; + if ( $self->patron ) { + $permitted = $self->check_limits( { patron => $self->patron }, { librarycode => $self->branchcode } ); + $result->{permitted} = $permitted; + $self->status('QUEUED')->store unless ($permitted); + } ## Handle Unmediated ILLs -- 2.49.0