From d5ff7f6c49162d14bd10f63ca47a33703a830947 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 --- Koha/Illbackend.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/Illbackend.pm b/Koha/Illbackend.pm index ab31d05495..6d95b5e2a7 100644 --- a/Koha/Illbackend.pm +++ b/Koha/Illbackend.pm @@ -88,9 +88,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