Bug 41440: Fix bug revealed by unit test

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c6ef3094ca)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
This commit is contained in:
Kyle M Hall 2026-04-07 09:02:54 -04:00 committed by Jacob O'Mara
parent 8d748916df
commit 0a28454705
No known key found for this signature in database
1 changed files with 3 additions and 2 deletions

View File

@ -812,9 +812,10 @@ sub get_rfc4646_from_iso639 {
return $cached if $cached;
my $rfc_subtag =
Koha::Database->new()->schema->resultset('LanguageRfc4646ToIso639')->find( { iso639_2_code => $iso_code } );
$memory_cache->set_in_cache( $cache_key, $rfc_subtag );
if ($rfc_subtag) {
return $rfc_subtag->rfc4646_subtag;
my $subtag = $rfc_subtag->rfc4646_subtag;
$memory_cache->set_in_cache( $cache_key, $subtag );
return $subtag;
} else {
return;
}