From dc919cac9c62111ab38a6f1bdb7abfb9a38ee8c5 Mon Sep 17 00:00:00 2001 From: Srdjan Date: Fri, 1 Nov 2013 21:05:09 +1300 Subject: [PATCH] Bug 11183: get rid of some log noise from the OPAC To test in OPAC: * With the OPAC System Preference EnableOpacSearchHistory set to Keep, a simple search triggers the warning patched on line 626 of opac-search.pl * Selecting a search result item with no Collection Code set triggers the warning patched on line 576 of opac-detail.pl * Have an item with Collection Code. Check that the Collection Code shows. * Collection Code is set by editing an item in the staff client (952$8) Signed-off-by: Mark Tompsett Signed-off-by: Kyle M Hall Signed-off-by: Galen Charlton (cherry picked from commit ec206d18980b2438cfe3da9e89455eda319dd8d7) Signed-off-by: Fridolin SOMERS --- opac/opac-detail.pl | 2 +- opac/opac-search.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 41de4fd8c1..77de12f7bf 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -573,7 +573,7 @@ for my $itm (@items) { # get collection code description, too my $ccode = $itm->{'ccode'}; - $itm->{'ccode'} = $collections->{$ccode} if ( defined($collections) && exists( $collections->{$ccode} ) ); + $itm->{'ccode'} = $collections->{$ccode} if defined($ccode) && $collections && exists( $collections->{$ccode} ); my $copynumber = $itm->{'copynumber'}; $itm->{'copynumber'} = $copynumbers->{$copynumber} if ( defined($copynumbers) && defined($copynumber) && exists( $copynumbers->{$copynumber} ) ); if ( defined $itm->{'location'} ) { diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 2854da6203..8604d0f529 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -623,7 +623,7 @@ for (my $i=0;$i<@servers;$i++) { my $query_cgi_history = $cgi->url(-query=>1); $query_cgi_history =~ s/^$path_info\?//; $query_cgi_history =~ s/;/&/g; - my $query_desc_history = "$query_desc, $limit_desc"; + my $query_desc_history = join ", ", grep { defined $_ } $query_desc, $limit_desc; if (!$borrowernumber || $borrowernumber eq '') { # To a cookie (the user is not logged in) -- 2.39.5