Bug 40351 - Koha/SearchEngine/Elasticsearch/Search.t generates a warning
Summary: Koha/SearchEngine/Elasticsearch/Search.t generates a warning
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low minor
Assignee: Jonathan Druart
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
Depends on:
Blocks: 40444
  Show dependency treegraph
 
Reported: 2025-07-11 12:48 UTC by Jonathan Druart
Modified: 2025-08-01 09:26 UTC (History)
2 users (show)

See Also:
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:


Attachments
Bug 40351: Remove warning from oha/SearchEngine/Elasticsearch/Search.t (2.01 KB, patch)
2025-07-11 12:50 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 40351: Remove warning from oha/SearchEngine/Elasticsearch/Search.t (2.07 KB, patch)
2025-07-12 10:14 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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