Bug 33896 - Catalog search from the masthead searchbar produces a warning in the logs
Summary: Catalog search from the masthead searchbar produces a warning in the logs
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial
Assignee: Matt Blenkinsop
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-05 13:45 UTC by Matt Blenkinsop
Modified: 2023-12-28 20:47 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00,23.05.02,22.11.08
Circulation function:


Attachments
Bug 33896: Check whether index is defined before string match (1.30 KB, patch)
2023-06-05 13:49 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 33896: Check whether index is defined before string match (1.34 KB, patch)
2023-06-06 05:40 UTC, David Cook
Details | Diff | Splinter Review
Bug 33896: Check whether index is defined before string match (1.39 KB, patch)
2023-06-22 20:16 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Blenkinsop 2023-06-05 13:45:40 UTC
To reproduce:
1) In the intranet, search the catalog from the top search bar
2) Check plack-intranet-error.log
3) There should be a warning "[WARN] Use of uninitialized value within @indexes in string eq"
Comment 1 Matt Blenkinsop 2023-06-05 13:49:40 UTC
Created attachment 151990 [details] [review]
Bug 33896: Check whether index is defined before string match

This patch checks that $indexes[$i] is defined before testing whether the string matches to remove the logged warning when searching

Test plan:
1) In the intranet, search the catalog from the top search bar
2) Check plack-intranet-error.log
3) There should be a warning "[WARN] Use of uninitialized value within @indexes in string eq"
4) Apply patch
5) restart_all and then re-try the search
6) The warning should no longer appear
Comment 2 David Cook 2023-06-06 05:40:34 UTC
Created attachment 152030 [details] [review]
Bug 33896: Check whether index is defined before string match

This patch checks that $indexes[$i] is defined before testing whether the string matches to remove the logged warning when searching

Test plan:
1) In the intranet, search the catalog from the top search bar
2) Check plack-intranet-error.log
3) There should be a warning "[WARN] Use of uninitialized value within @indexes in string eq"
4) Apply patch
5) restart_all and then re-try the search
6) The warning should no longer appear

Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 3 Katrin Fischer 2023-06-22 20:16:16 UTC
Created attachment 152588 [details] [review]
Bug 33896: Check whether index is defined before string match

This patch checks that $indexes[$i] is defined before testing whether the string matches to remove the logged warning when searching

Test plan:
1) In the intranet, search the catalog from the top search bar
2) Check plack-intranet-error.log
3) There should be a warning "[WARN] Use of uninitialized value within @indexes in string eq"
4) Apply patch
5) restart_all and then re-try the search
6) The warning should no longer appear

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Katrin Fischer 2023-06-22 20:16:35 UTC
Thank you, Matt :)
Comment 5 Tomás Cohen Arazi (tcohen) 2023-06-23 13:01:57 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 6 Martin Renvoize (ashimema) 2023-07-17 14:02:58 UTC
Thanks for all the hard work!

Pushed to 23.05.x for the next release
Comment 7 Pedro Amorim 2023-07-18 11:54:36 UTC
Nice work everyone!

Pushed to 22.11.x for next release