From 4e5fe41a59554d4b85eaccd70371a0a65512cd0e Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 15 Sep 2009 09:19:57 -0400 Subject: [PATCH] bug 3614 followup * renamed default_ind_to_space to _default_ind_to_space as it is an internal function * added calls to _default_ind_to_space in other places Signed-off-by: Galen Charlton --- C4/Biblio.pm | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index b851bc084e..cf48c91686 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -1675,10 +1675,10 @@ sub TransformHtmlToXml { if ( ( @$tags[$i] && @$tags[$i] > 10 ) && ( @$values[$i] ne "" ) ) { - my $ind1 = substr( @$indicator[$j], 0, 1 ); + my $ind1 = _default_ind_to_space(substr( @$indicator[$j], 0, 1 )); my $ind2; if ( @$indicator[$j] ) { - $ind2 = substr( @$indicator[$j], 1, 1 ); + $ind2 = _default_ind_to_space(substr( @$indicator[$j], 1, 1 )); } else { warn "Indicator in @$tags[$i] is empty"; @@ -1707,8 +1707,8 @@ sub TransformHtmlToXml { $first = 1; } else { - my $ind1 = default_ind_to_space( substr( @$indicator[$j], 0, 1 ) ); - my $ind2 = default_ind_to_space( substr( @$indicator[$j], 1, 1 ) ); + my $ind1 = _default_ind_to_space( substr( @$indicator[$j], 0, 1 ) ); + my $ind2 = _default_ind_to_space( substr( @$indicator[$j], 1, 1 ) ); $xml .= "\n"; $xml .= "@$values[$i]\n"; $first = 0; @@ -1721,8 +1721,8 @@ sub TransformHtmlToXml { } else { if ($first) { - my $ind1 = default_ind_to_space( substr( @$indicator[$j], 0, 1 ) ); - my $ind2 = default_ind_to_space( substr( @$indicator[$j], 1, 1 ) ); + my $ind1 = _default_ind_to_space( substr( @$indicator[$j], 0, 1 ) ); + my $ind2 = _default_ind_to_space( substr( @$indicator[$j], 1, 1 ) ); $xml .= "\n"; $first = 0; } @@ -1749,16 +1749,16 @@ sub TransformHtmlToXml { return $xml; } -=head2 default_ind_to_space +=head2 _default_ind_to_space Passed what should be an indicator returns a space if its undefined or zero length =cut -sub default_ind_to_space { +sub _default_ind_to_space { my $s = shift; - if (!defined $s || $s eq q{} ) { + if (!defined $s || $s eq q{}) { return ' '; } return $s; @@ -1836,8 +1836,8 @@ sub TransformHtmlToMarc { elsif ($param =~ /^tag_(\d*)_indicator1_/){ # new field start when having 'input name="..._indicator1_..." my $tag = $1; - my $ind1 = substr($cgi->param($param),0,1); - my $ind2 = substr($cgi->param($params->[$i+1]),0,1); + my $ind1 = _default_ind_to_space(substr($cgi->param($param), 0, 1)); + my $ind2 = _default_ind_to_space(substr($cgi->param($params->[$i+1]), 0, 1)); $newfield=0; my $j=$i+2; @@ -1866,8 +1866,8 @@ sub TransformHtmlToMarc { if ( $cgi->param($params->[$j+1]) ne '' ) { # creating only if there is a value (code => value) $newfield = MARC::Field->new( $tag, - ''.$ind1, - ''.$ind2, + $ind1, + $ind2, $cgi->param($inner_param) => $cgi->param($params->[$j+1]), ); } -- 2.39.5