Bugfix: Stop opac/opac-detail.pl from filling the log with pesky warns
authorChris Nighswonger <cnighswonger@foundations.edu>
Thu, 28 Jan 2010 19:49:29 +0000 (14:49 -0500)
committerGalen Charlton <gmcharlt@gmail.com>
Wed, 3 Feb 2010 00:16:04 +0000 (19:16 -0500)
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
opac/opac-detail.pl

index f0a7288..9af15a8 100755 (executable)
@@ -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);
 }