[Bug 18400] New: Noisy warns in opac-search.pl during itemtype sorting

classic Classic list List threaded Threaded
23 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 18400] New: Noisy warns in opac-search.pl during itemtype sorting

bugzilla-daemon
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: [hidden email]
          Reporter: [hidden email]
        QA Contact: [hidden email]

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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 18400] Noisy warns in opac-search.pl during itemtype sorting

bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400

Nick Clemens <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |Needs Signoff

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 18400] Noisy warns in opac-search.pl during itemtype sorting

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400

--- Comment #1 from Nick Clemens <[hidden email]> ---
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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 18400] Noisy warns in opac-search.pl during itemtype sorting

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400

Alex Buckley <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]
             Status|Needs Signoff               |Failed QA

--- Comment #2 from Alex Buckley <[hidden email]> ---
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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 18400] Noisy warns in opac-search.pl during itemtype sorting

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400

Nick Clemens <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Failed QA                   |Needs Signoff

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 18400] Noisy warns in opac-search.pl during itemtype sorting

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400

Nick Clemens <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #61976|0                           |1
        is obsolete|                            |

--- Comment #3 from Nick Clemens <[hidden email]> ---
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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 18400] Noisy warns in opac-search.pl during itemtype sorting

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400

Marc Véron <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #62224|0                           |1
        is obsolete|                            |

--- Comment #4 from Marc Véron <[hidden email]> ---
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 <[hidden email]>

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 18400] Noisy warns in opac-search.pl during itemtype sorting

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400

Katrin Fischer <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|[hidden email]         |[hidden email]
                 CC|                            |[hidden email]

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 18400] Noisy warns in opac-search.pl during itemtype sorting

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400

Katrin Fischer <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Needs Signoff               |Signed Off

--- Comment #5 from Katrin Fischer <[hidden email]> ---
Looks like Marc actually signed off, but status wasn't switched!

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 18400] Noisy warns in opac-search.pl during itemtype sorting

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400

Marcel de Rooy <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--- Comment #6 from Marcel de Rooy <[hidden email]> ---
QA: Looking here now

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 18400] Noisy warns in opac-search.pl during itemtype sorting

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400

Marcel de Rooy <[hidden email]> 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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 18400] Noisy warns in opac-search.pl during itemtype sorting

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400

Marcel de Rooy <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Signed Off                  |Passed QA

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 18400] Noisy warns in opac-search.pl during itemtype sorting

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400

Marcel de Rooy <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #62232|0                           |1
        is obsolete|                            |

--- Comment #7 from Marcel de Rooy <[hidden email]> ---
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 <[hidden email]>

Signed-off-by: Marcel de Rooy <[hidden email]>

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 18400] Noisy warns in opac-search.pl during itemtype sorting

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400

--- Comment #8 from Marcel de Rooy <[hidden email]> ---
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 <[hidden email]>

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 18400] Noisy warns in opac-search.pl during itemtype sorting

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400

Marcel de Rooy <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Patch complexity|---                         |Small patch
         QA Contact|[hidden email]-communit |[hidden email]
                   |y.org                       |
            Version|16.11                       |master

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 18400] Noisy warns in opac-search.pl during itemtype sorting

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400

--- Comment #9 from Marcel de Rooy <[hidden email]> ---
QA Comment:
See commit message of the follow-up.

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 18400] Noisy warns in opac-search.pl during itemtype sorting

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400

Kyle M Hall <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]
             Status|Passed QA                   |Pushed to Master

--- Comment #10 from Kyle M Hall <[hidden email]> ---
Pushed to master for 17.05, thanks Nick, Marcel!

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 18400] Noisy warns in opac-search.pl during itemtype sorting

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400

--- Comment #11 from Katrin Fischer <[hidden email]> ---
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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 18400] Noisy warns in opac-search.pl during itemtype sorting

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400

Pongtawat <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--- Comment #12 from Pongtawat <[hidden email]> ---
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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 18400] Noisy warns in opac-search.pl during itemtype sorting

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400

--- Comment #13 from Pongtawat <[hidden email]> ---
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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 18400] Noisy warns in opac-search.pl during itemtype sorting

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400

Katrin Fischer <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Pushed to Master            |Pushed to Stable

--- Comment #14 from Katrin Fischer <[hidden email]> ---
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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 18400] Noisy warns in opac-search.pl during itemtype sorting

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400

--- Comment #15 from Pongtawat <[hidden email]> ---
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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 18400] Noisy warns in opac-search.pl during itemtype sorting

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18400

Mason James <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--- Comment #16 from Mason James <[hidden email]> ---
Pushed to 16.05.x, for 16.05.15 release

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/