From 6c8d8bc88eda71c54b9833d2480ff8859b2c088f Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 24 Oct 2011 16:27:29 -0400 Subject: [PATCH] Clear shelf canceled holds notification fix After cancelling a batch of holds via the clear-shelf process, before we send the holds off to action/trigger for potential notification generation, re-fetch the holds from the DB to pick up the calculated cancel_time value (i.e. get a real value for "now"). Otherwise, A/T may die attempting to create a DateTime object by parsing "now". Signed-off-by: Bill Erickson Signed-off-by: Mike Rylander --- .../src/perlmods/lib/OpenILS/Application/Circ/Holds.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 3719afc3d7..ad5e9ad36a 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm @@ -3347,10 +3347,18 @@ sub clear_shelf_process { # tell the client we're done $client->respond_complete({cache_key => $cache_key}); + # ------------ # fire off the hold cancelation trigger and wait for response so don't flood the service + + # refetch the holds to pick up the caclulated cancel_time, + # which may be needed by Action/Trigger + $e->xact_begin; + my $updated_holds = $e->search_action_hold_request({id => $hold_ids}, {substream => 1}); + $e->rollback; + $U->create_events_for_hook( 'hold_request.cancel.expire_holds_shelf', - $_, $org_id, undef, undef, 1) for @holds; + $_, $org_id, undef, undef, 1) for @$updated_holds; } else { # tell the client we're done -- 2.43.2