From a87f78b017eb8f686af4c036c6dc7b26f4f48437 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 12 Feb 2026 12:03:56 +0100 Subject: [PATCH] Bug 41685: (QA follow-up) Prevent uninit warn on missing subfield a Content-Type: text/plain; charset=utf-8 Signed-off-by: Marcel de Rooy --- C4/AuthoritiesMarc.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index b0cc40ee14..7958dcc70a 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -1244,7 +1244,7 @@ sub _marc21_sort_hierarchy_alpha { $b_hier = 'gh' if $b_hier !~ /^[gh]$/; # When hierarchy does not resolve, sort on $a - $a_hier cmp $b_hier || $a->subfield('a') cmp $b->subfield('a'); + $a_hier cmp $b_hier || ( ( $a->subfield('a') // q{} ) cmp( $b->subfield('a') // q{} ) ); } @fields ); } -- 2.39.5