From a3ceef434ed17a1a1ad57c70cfbbc8f1fdf5d736 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 4 Nov 2010 11:38:45 +0000 Subject: [PATCH] Bug 4515 (Few very small errors in opac-search.pl) RESENT fixing whitespace warning Loop on results should stop before $i==@servers. Adding fix for warnings on undefined values in comparison for lines 485, 488 and 510. Signed-off-by: Chris Cormack --- opac/opac-search.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 30bc34a6b9..fda58b2278 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -431,7 +431,7 @@ if ($@ || $error) { # At this point, each server has given us a result set # now we build that set for template display my @sup_results_array; -for (my $i=0;$i<=@servers;$i++) { +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"}; @@ -482,10 +482,10 @@ for (my $i=0;$i<=@servers;$i++) { } # Adding the new search if needed - if ($borrowernumber eq '') { + if (!$borrowernumber || $borrowernumber eq '') { # To a cookie (the user is not logged in) - if ($params->{'offset'} eq '') { + if (($params->{'offset'}||'') eq '') { push @recentSearches, { "query_desc" => $query_desc || "unknown", @@ -507,7 +507,7 @@ for (my $i=0;$i<=@servers;$i++) { } else { # To the session (the user is logged in) - if ($params->{'offset'} eq '') { + if (($params->{'offset'}||'') eq '') { AddSearchHistory($borrowernumber, $cgi->cookie("CGISESSID"), $query_desc, $query_cgi, $total); $template->param(ShowOpacRecentSearchLink => 1); } -- 2.39.5