From 3ee8e7739f1a24b92bc2836807046fa56e608ce4 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 1 Sep 2011 14:07:40 +0200 Subject: [PATCH] [SIGNED-OFF] 6829: Remove two warnings for opac-MARCdetail Content-Type: text/plain; charset="utf-8" Remove two warnings from logfile by adding simple checks. Sept 1, revision: Clearing another warning (thx Owen) too. Signed-off-by: Owen Leonard --- opac/opac-MARCdetail.pl | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl index 7544902..ffa0a6d 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) ) { -- 1.7.3