From 68a8b49bf20437185f234e939cf7117285a8068b 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 --- C4/Biblio.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 803a921270..d20d7470d7 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -2184,10 +2184,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