When a patron cancels his/her own hold, create events for the
(already-existing) hold_request.cancel.patron A/T hook.
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
$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;
+ if ($e->requestor->id == $hold->usr) {
+ $U->create_events_for_hook('hold_request.cancel.patron', $hold, $hold->pickup_lib)
+ } else {
+ $U->create_events_for_hook('hold_request.cancel.staff', $hold, $hold->pickup_lib)
+ }
return 1;
}