diff --git a/C4/Search.pm b/C4/Search.pm index e2de36571e..248856e42b 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1694,7 +1694,7 @@ sub searchResults { $times = $offset + $results_per_page; } else { - $times = $hits; # If less hits than results_per_page+offset we go to the end + $times = $hits // 0; # If less hits than results_per_page+offset we go to the end } my $marcflavour = C4::Context->preference("marcflavour"); diff --git a/opac/opac-search.pl b/opac/opac-search.pl index ae864ee30c..16b69332ff 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -608,7 +608,7 @@ for my $plugin_variables ( @plugin_responses ) { for (my $i=0;$i<@servers;$i++) { my $server = $servers[$i]; if ($server && $server =~/biblioserver/) { # this is the local bibliographic server - $hits = $results_hashref->{$server}->{"hits"}; + $hits = $results_hashref->{$server}->{"hits"} // 0; if ( $hits == 0 && $basic_search ){ $operands[0] = '"'.$operands[0].'"'; #quote it ## I. BUILD THE QUERY