From e60894f9c6949a44b1ea882758d091caa8c434b8 Mon Sep 17 00:00:00 2001 From: Srdjan Date: Tue, 12 Nov 2013 20:53:39 +1300 Subject: [PATCH] bug_11183: Supress undef warning in opac-MARCdetail.pl To test: * Go to /cgi-bin/koha/opac-MARCdetail.pl?biblionumber= and confirm that pre and post patch page looks the same. An apology: I tried to find a syspref combination that displays opac-MARCdetail.pl links in OPAC search results, and failed. If anyone knows, the secret combination, please disclose. I resorted to entering the url by hand. --- opac/opac-MARCdetail.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl index d6be0a6..aa72a3e 100755 --- a/opac/opac-MARCdetail.pl +++ b/opac/opac-MARCdetail.pl @@ -176,8 +176,9 @@ for ( my $tabloop = 0 ; $tabloop <= 9 ; $tabloop++ ) { next if ( ($sf_def->{tab}||0) != $tabloop ); next if ( ($sf_def->{hidden}||0) > 0 ); my %subfield_data; - $subfield_data{marc_lib} = ($sf_def->{lib} eq $previous) ? '--' : $sf_def->{lib}; - $previous = $sf_def->{lib}; + my $lib = $sf_def->{lib} // ''; + $subfield_data{marc_lib} = ($lib eq $previous) ? '--' : $sf_def->{lib}; + $previous = $lib; $subfield_data{link} = $sf_def->{link}; $subf[$i][1] =~ s/\n//g; if ( $sf_def->{isurl} ) { -- 1.8.1.2