From: Bill Erickson Date: Tue, 18 Oct 2011 16:07:46 +0000 (-0400) Subject: Re-fetch hold for cancel notify to correct timestamp X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3185fc377b3005ca831813d77f8a5b9d4df40a7b;p=evergreen%2Fpines.git Re-fetch hold for cancel notify to correct timestamp Re-fetch the cancelled hold from the DB before passing it off to action/trigger for notification processing. Otherwise, A/T attempts to perform date math on "now" instead of a valid timestamp and subsequently croaks. Signed-off-by: Bill Erickson Signed-off-by: Lebbeous Fogle-Weekley --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm index f16c31ab02..0b7adad5fc 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm @@ -661,6 +661,11 @@ sub cancel_hold { $e->commit; + # re-fetch the hold to pick up the real cancel_time (not "now") for A/T + $e->xact_begin; + $hold = $e->retrieve_action_hold_request($hold->id) or return $e->die_event; + $e->rollback; + $U->create_events_for_hook('hold_request.cancel.staff', $hold, $hold->pickup_lib) if $e->requestor->id != $hold->usr;