From 4231def42e1b1256428407f7c4b53da896ba29d4 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Tue, 26 Sep 2023 09:33:08 +0000 Subject: [PATCH] Bug 34838: Only call strings_map if status_alias is not undef in status_alias cycle Because its highly likely that at least one request will have status_alias null in the database, the select MAX query will always return at least one result with NULL status_alias, throwing a warning, so we skip that Signed-off-by: Nick Clemens Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize --- Koha/ILL/Backend.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/ILL/Backend.pm b/Koha/ILL/Backend.pm index 287c59679e..a8fa635b8b 100644 --- a/Koha/ILL/Backend.pm +++ b/Koha/ILL/Backend.pm @@ -89,9 +89,9 @@ sub existing_statuses { } ); while ( my $request = $ill_requests->next ) { - my $status_data = $request->strings_map; + my $status_data = $request->status_alias ? $request->strings_map : undef; - if ( $status_data->{status_alias} ) { + if ( $status_data && $status_data->{status_alias} ) { push @data, { $status_data->{status_alias}->{str} ? ( str => $status_data->{status_alias}->{str} ) : $status_data->{status_alias}->{code} ? ( str => $status_data->{status_alias}->{code} ) -- 2.39.5