Bug 14075

Summary: Undefined value creates noisy warns in C4::AuthoritiesMarc
Product: Koha Reporter: Aleisha Amohia <aleisha>
Component: OPACAssignee: Aleisha Amohia <aleisha>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: chris, jonathan.druart, mtj, mtompset, tomascohen
Version: unspecified   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14076
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 14075: Undefined value creates noisy warns in C4::AuthoritiesMarc
Bug 14075: Undefined value creates noisy warns in C4::AuthoritiesMarc
Bug 14075: Undefined value creates noisy warns in C4::AuthoritiesMarc
Bug 14075: Undefined value creates noisy warns in C4::AuthoritiesMarc

Description Aleisha Amohia 2015-04-29 04:04:46 UTC
If sortby is not set and left as undefined, there are a bunch of noisy errors
Comment 1 Aleisha Amohia 2015-04-29 04:12:10 UTC Comment hidden (obsolete)
Comment 2 Mark Tompsett 2015-04-29 04:59:48 UTC
Comment on attachment 38624 [details] [review]
Bug 14075: Undefined value creates noisy warns in C4::AuthoritiesMarc

Review of attachment 38624 [details] [review]:
-----------------------------------------------------------------

::: C4/AuthoritiesMarc.pm
@@ +18,4 @@
>  
>  use strict;
>  use warnings;
> +use lib '.';

Why this addition?
Comment 3 Aleisha Amohia 2015-04-29 05:02:38 UTC
(In reply to M. Tompsett from comment #2)
> Comment on attachment 38624 [details] [review] [review]
> Bug 14075: Undefined value creates noisy warns in C4::AuthoritiesMarc
> 
> Review of attachment 38624 [details] [review] [review]:
> -----------------------------------------------------------------
> 
> ::: C4/AuthoritiesMarc.pm
> @@ +18,4 @@
> >  
> >  use strict;
> >  use warnings;
> > +use lib '.';
> 
> Why this addition?

Oops forgot to take that out when I was experimenting earlier! My bad
Comment 4 Aleisha Amohia 2015-04-29 05:04:58 UTC Comment hidden (obsolete)
Comment 5 Mark Tompsett 2015-04-29 05:24:38 UTC
Comment on attachment 38626 [details] [review]
Bug 14075: Undefined value creates noisy warns in C4::AuthoritiesMarc

Review of attachment 38626 [details] [review]:
-----------------------------------------------------------------

::: C4/AuthoritiesMarc.pm
@@ -18,4 @@
>  
>  use strict;
>  use warnings;
> -use lib '.';

Now you lost your change, because you obsoleted the other patch.
Comment 6 Aleisha Amohia 2015-04-29 05:27:53 UTC
(In reply to M. Tompsett from comment #5)
> Comment on attachment 38626 [details] [review] [review]
> Bug 14075: Undefined value creates noisy warns in C4::AuthoritiesMarc
> 
> Review of attachment 38626 [details] [review] [review]:
> -----------------------------------------------------------------
> 
> ::: C4/AuthoritiesMarc.pm
> @@ -18,4 @@
> >  
> >  use strict;
> >  use warnings;
> > -use lib '.';
> 
> Now you lost your change, because you obsoleted the other patch.

Of course oops my mistake again,thanks for fixing that
Comment 7 Mark Tompsett 2015-04-29 05:29:13 UTC Comment hidden (obsolete)
Comment 8 Jonathan Druart 2015-04-29 11:37:42 UTC
Created attachment 38660 [details] [review]
Bug 14075: Undefined value creates noisy warns in C4::AuthoritiesMarc

This match sets $sortby (previously undefined value) as an empty string to get rid of the warns.

To test:

1) Go to a URL such as http://localhost:8080/cgi-bin/koha/opac-authorities-home.pl?op=do_search&type=opac&operator=contains&value=a&marclist=any&and_or=and
2) Notice the warns in the error log
3) Apply patch
4) Reload URL
5) Notice page still works but no warns in error log

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

NOTE: I would have done $sortby //= '';
      But this works too. :)

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 9 Tomás Cohen Arazi 2015-05-06 18:27:20 UTC
Patch pushed to master.

Thanks Aleisha!
Comment 10 Chris Cormack 2015-05-17 06:45:12 UTC
Pushed to 3.18.x will be in 3.18.7
Comment 11 Mason James 2015-05-29 08:09:19 UTC
Pushed to 3.16.x, will be in 3.16.11