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 <berickxx@gmail.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
$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(
$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',