From b86fdb02e475b30c6e24020a189140a910631f46 Mon Sep 17 00:00:00 2001 From: Rom1-B Date: Mon, 25 Apr 2022 11:44:30 +0200 Subject: [PATCH] fix(followup): credit consumed even if the followup fails --- setup.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/setup.php b/setup.php index bc6ac43..296aabb 100644 --- a/setup.php +++ b/setup.php @@ -67,14 +67,11 @@ function plugin_init_credit() { 'displayVoucherInTicketProcessingForm' ]; - $PLUGIN_HOOKS['pre_item_add']['credit'] = [ + $PLUGIN_HOOKS['item_add']['credit'] = [ 'ITILFollowup' => ['PluginCreditTicket', 'consumeVoucher'], 'ITILSolution' => ['PluginCreditTicket', 'consumeVoucher'], 'TicketTask' => ['PluginCreditTicket', 'consumeVoucher'], - ]; - - $PLUGIN_HOOKS['item_add']['credit'] = [ - 'Ticket' => ['PluginCreditTicketConfig', 'updateConfig'], + 'Ticket' => ['PluginCreditTicketConfig', 'updateConfig'], ]; // Update config on 'pre_item_update' as only changing these fields in ticket form will not trigger 'item_update'. $PLUGIN_HOOKS['pre_item_update']['credit'] = [