[Koha-patches] [PATCH] Bugfix: Stop opac/opac-detail.pl from filling the log with pesky warns

Chris Nighswonger cnighswonger at foundations.edu
Thu Jan 28 20:49:29 CET 2010


---
 opac/opac-detail.pl |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl
index f0a7288..9af15a8 100755
--- a/opac/opac-detail.pl
+++ b/opac/opac-detail.pl
@@ -585,9 +585,9 @@ if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->pref
 
 #Search for title in links
 if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){
-    $search_for_title =~ s/{AUTHOR}/$dat->{author}/g;
-    $search_for_title =~ s/{TITLE}/$dat->{title}/g;
-    $search_for_title =~ s/{ISBN}/$isbn/g;
+    $dat->{author} ? $search_for_title =~ s/{AUTHOR}/$dat->{author}/g : $search_for_title =~ s/{AUTHOR}//g;
+    $dat->{title} ? $search_for_title =~ s/{TITLE}/$dat->{title}/g : $search_for_title =~ s/{TITLE}//g;
+    $isbn ? $search_for_title =~ s/{ISBN}/$isbn/g : $search_for_title =~ s/{ISBN}//g;
  $template->param('OPACSearchForTitleIn' => $search_for_title);
 }
 
-- 
1.6.0.4




More information about the Koha-patches mailing list