allow open-ils.circ.hold.update.batch to apply nulls to fields
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 15 Jul 2010 21:34:06 +0000 (21:34 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 15 Jul 2010 21:34:06 +0000 (21:34 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16948 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm

index 6fdcae9..4ecde19 100644 (file)
@@ -741,7 +741,13 @@ sub update_hold_impl {
     unless($hold) {
         $hold = $e->retrieve_action_hold_request($values->{id})
             or return $e->die_event;
-        $hold->$_($values->{$_}) for keys %$values;
+        for my $k (keys %$values) {
+            if (defined $values->{$k}) {
+                $hold->$k($values->{$k});
+            } else {
+                my $f = "clear_$k"; $hold->$f();
+            }
+        }
     }
 
     my $orig_hold = $e->retrieve_action_hold_request($hold->id)