From 526eafe4e1941d72d59bc6d51cb08bbd6ab386b7 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 3 Jan 2008 12:36:26 -0600 Subject: [PATCH] check for undefined values when mapping item to MARC Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Items.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Items.pm b/C4/Items.pm index 651dad08eb..e7f8e315b6 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -775,7 +775,7 @@ sub _marc_from_item_hash { # Tack on 'items.' prefix to column names so lookup from MARC frameworks will work # Also, don't emit a subfield if the underlying field is blank. - my $mungeditem = { map { $item->{$_} ne '' ? + my $mungeditem = { map { (defined($item->{$_}) and $item->{$_} ne '') ? (/^items\./ ? ($_ => $item->{$_}) : ("items.$_" => $item->{$_})) : () } keys %{ $item } }; -- 2.39.5