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. This is because 'weight_search_submitted' is not initialized for this search. You get the same effect with this simple test: #!/usr/bin/perl use Modern::Perl; use Data::Dumper; say Dumper( { one => 1, two => &und } ); sub und { #return undef; } But if you uncomment 'return undef', there is no warning. So most probably, in this case, $cgi->param('weight_search_submitted') returns an empty list, not an undef.
Created attachment 193341 [details] [review] 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
Created attachment 193362 [details] [review] 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>