Changed the thawing of a hold to first update the hold record and then re-target.
[transitory.git] / Open-ILS / src / perlmods / lib / OpenILS / Application / Circ / Holds.pm
index b72db96..1dee0c3 100644 (file)
@@ -1003,10 +1003,20 @@ sub update_hold_impl {
         }
     } 
 
-    update_hold_if_frozen($self, $e, $hold, $orig_hold);
+    if($U->is_true($hold->frozen)) {
+        $logger->info("clearing current_copy and check_time for frozen hold ".$hold->id);
+        $hold->clear_current_copy;
+        $hold->clear_prev_check_time;
+    }
+
     $e->update_action_hold_request($hold) or return $e->die_event;
     $e->commit;
 
+    if(!$U->is_true($hold->frozen) && $U->is_true($orig_hold->frozen)) {
+        $logger->info("Running targeter on activated hold ".$hold->id);
+        $U->storagereq( 'open-ils.storage.action.hold_request.copy_targeter', undef, $hold->id );
+    }
+
     # a change to mint-condition changes the set of potential copies, so retarget the hold;
     if($U->is_true($hold->mint_condition) and !$U->is_true($orig_hold->mint_condition)) {
         _reset_hold($self, $e->requestor, $hold)