[Bug 18400] New: Noisy warns in opac-search.pl during itemtype sorting
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400 Bug ID: 18400 Summary: Noisy warns in opac-search.pl during itemtype sorting Change sponsored?: --- Product: Koha Version: 16.11 Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org Cannot reliably recreate, but seeing in 3.22 - 16.11 when searching in opac we get lots of: opac-search.pl: Use of uninitialized value in string comparison (cmp) at /usr/share/koha/opac/cgi-bin/opac/opac-search.pl Tracing the error it seems $itemtype can be corrupted and has keys added like this (when dumped): $VAR1 = 'MICROFORM'; $VAR2 = '1VOLTREAT'; $VAR3 = 'HASH(0x954d948)'; $VAR4 = 'HASH(0x9083428)'; etc. This filled a disk on one of our servers -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 61976 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61976&action=edit Bug 18400 - Noisy warns in opac-search.pl during itemtype sorting To fix the warns we use a copy of itemtypes which is not touched by other code To test: Apply patches Ensure search still works -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |alexbuckley@catalyst.net.nz Status|Needs Signoff |Failed QA --- Comment #2 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Hi Nick When applying your patch (in a clean up to date branch) there is a merge conflict where you have changed the opac/opac-search.pl (see below). I fixed that locally by keeping the contents of lines 234-237 and removing the contents of lines 232,233 and 238. 232 <<<<<<< HEAD 233 ======= 234 my $itemtypes_copy = { %$itemtypes }; #Sometime itemtypes can be c orrupted in advanced_srch_type loop 235 #Making a copy ensure it is clean 236 # Load the Type stuff without search categories for facets 237 my $itemtypes_nocategory = GetItemTypes; 238 >>>>>>> Bug 18400 - Noisy warns in opac-search.pl during itemtype sorting Then whilst testing I used the OPAC search and I got the following software error: Bareword "GetItemTypes" not allowed while "strict subs" in use at /home/vagrant/kohaclone/opac/opac-search.pl line 235. Execution of /home/vagrant/kohaclone/opac/opac-search.pl aborted due to compilation errors. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #61976|0 |1 is obsolete| | --- Comment #3 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 62224 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62224&action=edit Bug 18400 - Noisy warns in opac-search.pl during itemtype sorting To fix the warns we use a copy of itemtypes which is not touched by other code To test: Apply patches Ensure search still works -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #62224|0 |1 is obsolete| | --- Comment #4 from Marc Véron <veron@veron.ch> --- Created attachment 62232 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62232&action=edit Bug 18400 - Noisy warns in opac-search.pl during itemtype sorting To fix the warns we use a copy of itemtypes which is not touched by other code To test: Apply patches Ensure search still works Followed test plan, search works as expected. Signed-off-by: Marc Véron <veron@veron.ch> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |nick@bywatersolutions.com CC| |katrin.fischer@bsz-bw.de -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Looks like Marc actually signed off, but status wasn't switched! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- QA: Looking here now -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=10937 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #62232|0 |1 is obsolete| | --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 63416 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63416&action=edit Bug 18400 - Noisy warns in opac-search.pl during itemtype sorting To fix the warns we use a copy of itemtypes which is not touched by other code To test: Apply patches Ensure search still works Followed test plan, search works as expected. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400 --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 63417 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63417&action=edit Bug 18400: [QA Follow-up] Move sort outside the loop GetItemTypesCategorized can return descriptions that are still undef since Authorized values does not enforce a description in lib and lib_opac. When I add one ITEMTYPECAT auth value without descriptions, I can still generate the string comparison warnings on the itemtypes sort. In order to prevent the warning, we should add an empty string in the assignment on line 229. We do not need to copy the itemtypes hash if we move the sort outside the @advanced_search_types foreach. There is no need to sort it more than once. Note that I did not see any reasons btw for corruption of the structure inside this loop. Note: If we use ITEMTYPECAT without descriptions, we should probably leave them out. No need to show a checkbox without description on Advanced Search, but I would recommend to solve that on its own report. The whole ITEMTYPECAT functionality has imo not been designed properly. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | Version|16.11 |master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400 --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- QA Comment: See commit message of the follow-up. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Status|Passed QA |Pushed to Master --- Comment #10 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to master for 17.05, thanks Nick, Marcel! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400 --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Patches don't apply cleanly on 16.11.x - please rebase if you think it should be in the next stable release! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400 Pongtawat <pongtawat@punsarn.asia> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pongtawat@punsarn.asia --- Comment #12 from Pongtawat <pongtawat@punsarn.asia> --- We also encounter this problem in 16.11. My teammate found out the reason for $itemtype corruption was line 291: searchcategory => $itemtypes->{$thisitemtype}->{'searchcategory'}, This automatically add a hash ->{'searchcategory'} to $itemtypes. The correct code should likely be: searchcategory => $thisitemtype->{'searchcategory'}, I attached a patch for 16.11. We tested this on our 16.11 installation and it also fix the problem. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400 --- Comment #13 from Pongtawat <pongtawat@punsarn.asia> --- Created attachment 64718 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64718&action=edit Bug 18400 - [16.11] Noisy warns in opac-search.pl during itemtype sorting -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable --- Comment #14 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Thx for the 16.11.x patch! This patch has been pushed to 16.11.x and will be in 16.11.10. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400 --- Comment #15 from Pongtawat <pongtawat@punsarn.asia> --- Thanks for pushing! Could you also consider it for 17.05 and master too? Although the noisy messages were gone by the previous patch, the code on line 291 is probably incorrect. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtj@kohaaloha.com --- Comment #16 from Mason James <mtj@kohaaloha.com> --- Pushed to 16.05.x, for 16.05.15 release -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org