Bug 12861

Summary: Noisy warns in C4/AuthoritiesMarc.pm
Product: Koha Reporter: Chris Cormack <chris>
Component: OPACAssignee: Chris Cormack <chris>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: jonathan.druart, m.de.rooy, mtj, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 12861 : Noisy warn in the error logs
Bug 12861 : Noisy warn in the error logs
Bug 12861 : Noisy warn in the error logs
Bug 12861: (follow-up) Noisy warn in error logs
Bug 12861: (follow-up) Noisy warn in error logs
Bug 12861 : Noisy warn in the error logs
Bug 12861: (follow-up) Noisy warn in error logs

Description Chris Cormack 2014-09-02 22:05:31 UTC
If you hit a url like 
cgi-bin/koha/opac-authorities-home.pl?op=do_search&type=opac&operatorc=contains&marclistc=mainentry&and_orc=and&orderby=HeadingAsc&value=FIRECLAY

You will see a lot of this

opac-authorities-home.pl: Use of uninitialized value in string eq at /usr/share/koha/lib/C4/AuthoritiesMarc.pm line 146, <DATA> line 522.

In the error logs
Comment 1 Chris Cormack 2014-09-02 22:06:23 UTC Comment hidden (obsolete)
Comment 2 Marcel de Rooy 2014-10-06 13:31:01 UTC
-            else { # Assume any if no index was specified
-                $attr = " \@attr 1=Any ";
-            }

From glancing thru this code:
The place of this else in the old code and in the new code is different.
In the new code you are not reaching this point anymore.
Comment 3 Chris Cormack 2014-10-27 05:41:52 UTC Comment hidden (obsolete)
Comment 4 Marcel de Rooy 2015-01-15 13:45:45 UTC Comment hidden (obsolete)
Comment 5 Marcel de Rooy 2015-01-15 13:54:33 UTC
opac-authorities-home.pl: Use of uninitialized value $i in string eq at /usr/share/koha/testclone/C4/AuthoritiesMarc.pm line 172.
opac-authorities-home.pl: Use of uninitialized value $i in string eq at /usr/share/koha/testclone/C4/AuthoritiesMarc.pm line 176.
opac-authorities-home.pl: Use of uninitialized value $i in string eq at /usr/share/koha/testclone/C4/AuthoritiesMarc.pm line 179.
opac-authorities-home.pl: Use of uninitialized value $i in string eq at /usr/share/koha/testclone/C4/AuthoritiesMarc.pm line 183.
Comment 6 Jonathan Druart 2015-01-15 14:20:49 UTC Comment hidden (obsolete)
Comment 7 Jonathan Druart 2015-01-15 14:21:48 UTC
Could I get a signoff on the second patch please?
Comment 8 Marcel de Rooy 2015-01-19 07:38:38 UTC Comment hidden (obsolete)
Comment 9 Jonathan Druart 2015-01-19 09:37:05 UTC
Created attachment 35364 [details] [review]
Bug 12861 : Noisy warn in the error logs

To test
Hit a url like
cgi-bin/koha/opac-authorities-home.pl?op=do_search&type=opac&operatorc=contains&marclistc=mainentry&and_orc=and&orderby=HeadingAsc&value=FIRECLAY

Notice the warns in the error log
Apply patch
Reload the url
Still works but no warns

(cherry picked from commit c98d805e490a82b2ea9f3d4e0f7278640942ba6d)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Reformatted to fix error M Tompsett spotted

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Instead of 10 warnings, I now have only 4 warnings.
We're going in the right direction.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 10 Jonathan Druart 2015-01-19 09:37:11 UTC
Created attachment 35365 [details] [review]
Bug 12861: (follow-up) Noisy warn in error logs

Completely get rid of warns.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 11 Tomás Cohen Arazi 2015-01-21 14:11:11 UTC
Patches pushed to master.

Thanks Chris and Jonathan!
Comment 12 Chris Cormack 2015-02-01 03:35:40 UTC
Pushed to 3.18.x will be in 3.18.4
Comment 13 Mason James 2015-02-26 02:48:43 UTC
(In reply to Chris Cormack from comment #12)
> Pushed to 3.18.x will be in 3.18.4

Pushed to 3.16.x, will be in 3.16.8