bug 1616: handle NULL in damaged, wthdrawn, or itemlost columns
authorGalen Charlton <galen.charlton@liblime.com>
Tue, 27 Nov 2007 20:08:05 +0000 (14:08 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Tue, 27 Nov 2007 21:52:04 +0000 (15:52 -0600)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
catalogue/updateitem.pl

index b414c30..41e2dd5 100755 (executable)
@@ -41,13 +41,13 @@ my $dbh = C4::Context->dbh;
 my $item_data_hashref = GetItem($itemnumber, undef);
 
 # modify bib MARC
-if ($itemlost ne $item_data_hashref->{'itemlost'}) {
+if ((not defined($item_data_hashref->{'itemlost'})) or ($itemlost ne $item_data_hashref->{'itemlost'})) {
     ModItemInMarconefield($biblionumber, $itemnumber, 'items.itemlost', $itemlost);
 }
-if ($wthdrawn ne $item_data_hashref->{'wthdrawn'}) {
+if ((not defined($item_data_hashref->{'wthdrawn'})) or ($wthdrawn ne $item_data_hashref->{'wthdrawn'})) {
     ModItemInMarconefield($biblionumber, $itemnumber, 'items.wthdrawn', $wthdrawn);
 }
-if ($damaged ne $item_data_hashref->{'damaged'}) {
+if ((not defined($item_data_hashref->{'damaged'})) or ($damaged ne $item_data_hashref->{'damaged'})) {
     ModItemInMarconefield($biblionumber, $itemnumber, 'items.damaged', $damaged);
 }