Bug 19991: Remove warning from opac-user
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 15 Aug 2018 18:17:57 +0000 (15:17 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 30 Aug 2018 13:40:32 +0000 (13:40 +0000)
Use of uninitialized value in split at
/home/vagrant/kohaclone/opac/opac-user.pl line 78.

Use of uninitialized value $search_query in string ne at
/home/vagrant/kohaclone/opac/opac-user.pl line 367.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

opac/opac-user.pl

index 3e194c9..e599cec 100755 (executable)
@@ -75,7 +75,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
     }
 );
 
-my %renewed = map { $_ => 1 } split( ':', $query->param('renewed') );
+my %renewed = map { $_ => 1 } split( ':', $query->param('renewed') || '' );
 
 my $show_priority;
 for ( C4::Context->preference("OPACShowHoldQueueDetails") ) {
@@ -364,7 +364,7 @@ $template->param(
 # back to the opac-results page
 my $search_query = $query->param('has-search-query');
 
-if ($search_query ne '') {
+if ($search_query) {
 
     print $query->redirect(
         -uri    => "/cgi-bin/koha/opac-search.pl?$search_query",