Bug 14075: Undefined value creates noisy warns in C4::AuthoritiesMarc
authorAleisha <aleishaamohia@hotmail.com>
Wed, 29 Apr 2015 01:56:45 +0000 (01:56 +0000)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Wed, 6 May 2015 18:26:04 +0000 (15:26 -0300)
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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
C4/AuthoritiesMarc.pm

index 03b0b51..c311fb2 100644 (file)
@@ -109,6 +109,7 @@ sub SearchAuthorities {
     my ($tags, $and_or, $excluding, $operator, $value, $offset,$length,$authtypecode,$sortby,$skipmetadata) = @_;
     # warn Dumper($tags, $and_or, $excluding, $operator, $value, $offset,$length,$authtypecode,$sortby);
     my $dbh=C4::Context->dbh;
+    $sortby="" unless $sortby;
     my $query;
     my $qpquery = '';
     my $QParser;