[Koha-patches] [PATCH] bug_11183: Supress undef warning in opac-MARCdetail.pl

Srdjan srdjan at catalyst.net.nz
Tue Nov 12 08:59:12 CET 2013


To test:
* Go to /cgi-bin/koha/opac-MARCdetail.pl?biblionumber=<your fav 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/<br\/>/g;
                 if ( $sf_def->{isurl} ) {
-- 
1.8.1.2


More information about the Koha-patches mailing list