From caae541135dedb5d0ccddbf8ffd31887f802332d Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 1 Sep 2011 14:07:40 +0200 Subject: [PATCH] 6829: Remove two warnings for opac-MARCdetail Remove two warnings from logfile by adding simple checks. Sept 1, revision: Clearing another warning (thx Owen) too. Signed-off-by: Owen Leonard Signed-off-by: Chris Cormack --- opac/opac-MARCdetail.pl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl index 754490208f..ffa0a6d7df 100755 --- a/opac/opac-MARCdetail.pl +++ b/opac/opac-MARCdetail.pl @@ -142,8 +142,8 @@ for ( my $tabloop = 0 ; $tabloop <= 10 ; $tabloop++ ) { for my $i ( 0 .. $#subf ) { $subf[$i][0] = "@" unless $subf[$i][0]; my $sf_def = $tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] }; - next if ( $sf_def->{tab} ne $tabloop ); - next if ( $sf_def->{hidden} > 0 ); + next if ( ($sf_def->{tab}||'') ne $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}; @@ -215,8 +215,8 @@ foreach my $field (@fields) { # loop through each subfield for my $i ( 0 .. $#subf ) { my $sf_def = $tagslib->{ $field->tag() }->{ $subf[$i][0] }; - next if ( $sf_def->{tab} ne 10 ); - next if ( $sf_def->{hidden} > 0 ); + next if ( ($sf_def->{tab}||'') ne 10 ); + next if ( ($sf_def->{hidden}||0) > 0 ); $witness{ $subf[$i][0] } = $sf_def->{lib}; if ( $sf_def->{isurl} ) { @@ -237,7 +237,7 @@ foreach my $field (@fields) { my ( $holdingbrtagf, $holdingbrtagsubf ) = &GetMarcFromKohaField( "items.holdingbranch", $itemtype ); @big_array = - sort { $a->{$holdingbrtagsubf} cmp $b->{$holdingbrtagsubf} } @big_array; + sort { ($a->{$holdingbrtagsubf}||'') cmp ($b->{$holdingbrtagsubf}||'') } @big_array; #fill big_row with missing datas foreach my $subfield_code ( keys(%witness) ) { -- 2.39.5