From a9d6720d4a313ef35a1621c820b0f7e15d385d93 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 11 Jul 2025 14:49:32 +0200 Subject: [PATCH] Bug 40351: Remove warning from oha/SearchEngine/Elasticsearch/Search.t Use of uninitialized value in string comparison (cmp) at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch/Search.pm line 536. I think this is the correct fix. We generate a random av category that is used in the data, so $label get undef: 521 $label = $authorised_values{$t}; --- Koha/SearchEngine/Elasticsearch/Search.pm | 4 ++-- t/db_dependent/Koha/SearchEngine/Elasticsearch/Search.t | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Koha/SearchEngine/Elasticsearch/Search.pm b/Koha/SearchEngine/Elasticsearch/Search.pm index c88345bb582..64fce64de5d 100644 --- a/Koha/SearchEngine/Elasticsearch/Search.pm +++ b/Koha/SearchEngine/Elasticsearch/Search.pm @@ -526,8 +526,8 @@ sub _convert_facets { facet_count => $c, facet_link_value => $t, facet_title_value => $t, - facet_label_value => $label, # TODO either truncate this, - # or make the template do it like it should anyway + facet_label_value => $label || q{}, # TODO either truncate this, + # or make the template do it like it should anyway type_link_value => $type, }; } diff --git a/t/db_dependent/Koha/SearchEngine/Elasticsearch/Search.t b/t/db_dependent/Koha/SearchEngine/Elasticsearch/Search.t index 5e71ba5f313..d5b8790abeb 100755 --- a/t/db_dependent/Koha/SearchEngine/Elasticsearch/Search.t +++ b/t/db_dependent/Koha/SearchEngine/Elasticsearch/Search.t @@ -17,7 +17,8 @@ use Modern::Perl; -use Test::More tests => 14; +use Test::More tests => 15; +use Test::NoWarnings; use t::lib::Mocks; use t::lib::TestBuilder; -- 2.34.1