From 945512c0f8bb9ddce0f459bb9704dd6745904748 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 1 Apr 2026 18:15:32 +0000 Subject: [PATCH] Bug 41440: (QA follow-up) Handle undef "script" This silences warnings about undefinved values in the cache key This seems to come from some calls in _build_languages_arrayref where we might not have all variants of a language - the call could be prevented, but I am not sure what the effects would be, so I simply convert undef (null value) to "undef" (string) and use that as the cache key Signed-off-by: Kyle M Hall Signed-off-by: Lucas Gass (cherry picked from commit 365770c396192e93949e611a340ddbda231ff6ea) Signed-off-by: Jacob O'Mara --- C4/Languages.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/C4/Languages.pm b/C4/Languages.pm index c79d2bb0c2..b9ed3e2acf 100644 --- a/C4/Languages.pm +++ b/C4/Languages.pm @@ -481,8 +481,9 @@ Missing POD for language_get_description. sub language_get_description { my ( $script, $lang, $type ) = @_; + my $script_key = $script || "undef"; my $memory_cache = Koha::Cache::Memory::Lite->get_instance; - my $cache_key = "Language_descriptions:$script:$lang:$type"; + my $cache_key = "Language_descriptions:$script_key:$lang:$type"; my $cached = $memory_cache->get_from_cache($cache_key); return $cached if $cached;