From 322f1dfe081c1b9005a8b0f52840c3598d8fb7de Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Tue, 21 Jul 2009 11:59:09 +0100 Subject: [PATCH] Explicitly set _find_value's return to a string if not defined Avoids generating a slew of warnings in the log when the undefined value was concatenated or used in regexps Signed-off-by: Galen Charlton Signed-off-by: Henri-Damien LAURENT --- C4/Biblio.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 91a4f50053..74e1acef09 100755 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -2172,10 +2172,14 @@ sub PrepareItemrecordDisplay { $tagslib->{$tag}->{$subfield}->{repeatable}; $subfield_data{hidden} = "display:none" if $tagslib->{$tag}->{$subfield}->{hidden}; - my ( $x, $value ); - ( $x, $value ) = _find_value( $tag, $subfield, $itemrecord ) - if ($itemrecord); - $value =~ s/"/"/g; + my ( $x, $value ); + if ($itemrecord) { + ( $x, $value ) = _find_value( $tag, $subfield, $itemrecord ); + } + if (!defined $value) { + $value = q||; + } + $value =~ s/"/"/g; # search for itemcallnumber if applicable if ( $tagslib->{$tag}->{$subfield}->{kohafield} eq -- 2.39.5