Bug 41864: (Bug 40966 follow-up) Simple OPAC search generates warnings: Odd number of elements in anonymous hash

After introducing Bug 40966 opac-search.pl, when invoked in the
simple form (not as advanced search) generates warnings like:

[WARN] Odd number of elements in anonymous hash at /kohadevbox/koha/opac/opac-search.pl line 529.

Test plan:
==========
1. Perform a simple search from main OPAC page.
2. Check the content of plack-opac-error.log. You should see a
   warning like:
   [WARN] Odd number of elements in anonymous hash at /kohadevbox/koha/opac/opac-search.pl line 529.
3. Apply the patch ; restart_all.
4. Repeat p. 1. There should be no new warning now.

Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Janusz Kaczmarek 2026-02-18 11:28:09 +00:00 committed by Lucas Gass
parent 1c50f6b774
commit 184e966de4
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 1 additions and 1 deletions

View File

@ -539,7 +539,7 @@ if ( C4::Context->preference('OpacSuppression') ) {
suppress => $suppress,
is_opac => 1,
weighted_fields => $weight_search,
weight_search_submitted => $cgi->param('weight_search_submitted')
weight_search_submitted => $cgi->param('weight_search_submitted') // undef
}
);