Skip to content

Commit d1f9e9a

Browse files
committed
Try Fix #54
Thanks
1 parent 9afd2bf commit d1f9e9a

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

setup.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ function plugin_init_satisfaction()
7272
$PLUGIN_HOOKS['pre_item_update']['satisfaction'][TicketSatisfaction::class] = [
7373
SurveyAnswer::class, 'preUpdateSatisfaction'];
7474

75-
$PLUGIN_HOOKS['item_get_events']['satisfaction'] =
76-
['NotificationTargetTicket' => [NotificationTargetTicket::class, 'addEvents']];
7775

7876
$PLUGIN_HOOKS['item_delete']['satisfaction'] = ['Ticket' => [Reminder::class, 'deleteItem']];
7977

@@ -94,6 +92,9 @@ function plugin_init_satisfaction()
9492
}
9593
}
9694

95+
$PLUGIN_HOOKS['item_get_events']['satisfaction'] =
96+
['NotificationTargetTicket' => [NotificationTargetTicket::class, 'addEvents']];
97+
9798
$PLUGIN_HOOKS['item_get_datas']['satisfaction'] = [
9899
NotificationTargetTicket::class => [SurveyAnswer::class,
99100
'addNotificationDatas']];

src/NotificationTargetTicket.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,10 @@ public function getEvents()
5555

5656
public static function addEvents(\NotificationTargetTicket $target)
5757
{
58-
59-
$target->events['survey_reminder']
60-
= __('Survey Reminder', 'satisfaction');
58+
if (!isset($target->events['survey_reminder'])) {
59+
$target->events['survey_reminder']
60+
= __('Survey Reminder', 'satisfaction');
61+
}
6162
}
6263

6364
public function addDataForTemplate($event, $options = []) {

0 commit comments

Comments
 (0)