From 169a8a264aa0db2fad3f804bc91448afb59de3a2 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Tue, 31 Aug 2021 13:22:32 +0000 Subject: [PATCH] Bug 27945: (QA follow-up) Fix limit check Content-Type: text/plain; charset=utf-8 Resolve: [WARN] SQL::Abstract::belch(): [SQL::Abstract::_where_field_op_ARRAYREF] Warning: A multi-element arrayref as an argument to the inequality op '!=' is technically equivalent to an always-true 1=1 (you probably wanted to say ...{ $inequality_op => [ -and => @values ] }... instead) at /usr/share/koha/Koha/Objects.pm line 601 In this case we can simply count the statuses PENDING and PROCESSING. Note that bug 27944 will change that; PENDING should be replaced by REQUESTED there. Signed-off-by: Marcel de Rooy --- Koha/Patron.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index e66fdf4247..4a646cad5b 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -975,7 +975,7 @@ sub can_request_article { my $dtf = Koha::Database->new->schema->storage->datetime_parser; my $compdate = dt_from_string->add( days => -1 ); my $count = Koha::ArticleRequests->search([ - { borrowernumber => $self->borrowernumber, status => { '!=' => ['CANCELED','COMPLETED'] } }, + { borrowernumber => $self->borrowernumber, status => ['PENDING','PROCESSING'] }, { borrowernumber => $self->borrowernumber, status => 'COMPLETED', updated_on => { '>', $dtf->format_date($compdate) }}, ])->count; return $count < $limit ? 1 : 0; -- 2.20.1