Bug 40351

Summary: Koha/SearchEngine/Elasticsearch/Search.t generates a warning
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Test SuiteAssignee: Jonathan Druart <jonathan.druart>
Status: Pushed to oldstable --- QA Contact: Martin Renvoize (ashimema) <martin.renvoize>
Severity: minor    
Priority: P5 - low CC: fridolin.somers, martin.renvoize
Version: unspecified   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
25.11.00,25.05.02,24.11.08
Circulation function:
Bug Depends on:    
Bug Blocks: 40444    
Attachments: Bug 40351: Remove warning from oha/SearchEngine/Elasticsearch/Search.t
Bug 40351: Remove warning from oha/SearchEngine/Elasticsearch/Search.t

Description Jonathan Druart 2025-07-11 12:48:43 UTC
Use of uninitialized value in string comparison (cmp) at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch/Search.pm line 536.
Comment 1 Jonathan Druart 2025-07-11 12:50:57 UTC
Created attachment 183992 [details] [review]
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};
Comment 2 Martin Renvoize (ashimema) 2025-07-12 10:14:27 UTC
Created attachment 184028 [details] [review]
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};

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 3 Lucas Gass (lukeg) 2025-07-15 22:35:14 UTC
Nice work everyone!

Pushed to main for 25.11
Comment 4 Paul Derscheid 2025-07-24 08:20:53 UTC
Nice work everyone!

Pushed to 25.05.x
Comment 5 Fridolin Somers 2025-08-01 09:26:52 UTC
Pushed to 24.11.x for 24.11.08