From: Bill Erickson Date: Thu, 16 Feb 2023 16:02:49 +0000 (-0500) Subject: LP2007591 Allow Last-Copy Delete to Create Hold Notices X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a82a3dc67148d3315dd024f1170eb0f7bff7960f;p=Evergreen.git LP2007591 Allow Last-Copy Delete to Create Hold Notices Fixes an issue where attempting to create A/T events for recently canceled holds fails becuase the cancel_time on the hold is the pre-insert value of "now" instead of a valid date string. Resolve the issue by fetching the post-insert copy of the hold, so it has all of the correct in-database values, before passing the hold to A/T for processing. Signed-off-by: Bill Erickson Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm index 079fed631e..42e0451357 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm @@ -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( diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/BibCommon.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/BibCommon.pm index 5f48f7d97c..d10cfd1f1d 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/BibCommon.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/BibCommon.pm @@ -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',