LPXXX Allow Last-Copy Delete to Create Hold Notices user/berick/lpxxx-last-copy-hold-cancel-notice
authorBill Erickson <berickxx@gmail.com>
Thu, 16 Feb 2023 16:02:49 +0000 (11:02 -0500)
committerBill Erickson <berickxx@gmail.com>
Thu, 16 Feb 2023 16:02:49 +0000 (11:02 -0500)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/BibCommon.pm

index 079fed6..42e0451 100644 (file)
@@ -575,6 +575,10 @@ sub cancel_hold_list {
         $hold->cancel_cause(1); # un-targeted expiration.  Do we need an alternate "target deleted" cause?
         $editor->update_action_hold_request($hold) or return $editor->die_event;
 
+        # Update our copy of the hold to pick up the cancel_time
+        # before we pass it off to A/T.
+        $hold = $editor->retrieve_action_hold_request($hold->id);
+
         # tell A/T the hold was cancelled.  Don't wait for a response..
         my $at_ses = OpenSRF::AppSession->create('open-ils.trigger');
         $at_ses->request(
index 5f48f7d..d10cfd1 100644 (file)
@@ -364,6 +364,10 @@ sub delete_rec {
         $hold->cancel_cause(1); # un-targeted expiration.
         $editor->update_action_hold_request($hold) or return $editor->die_event;
 
+        # Update our copy of the hold to pick up the cancel_time
+        # before we pass it off to A/T.
+        $hold = $editor->retrieve_action_hold_request($hold->id);
+
         my $at_ses = OpenSRF::AppSession->create('open-ils.trigger');
         $at_ses->request(
             'open-ils.trigger.event.autocreate',