summaryrefslogtreecommitdiff
path: root/app/Subscriber
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-04-06 18:41:51 -0400
committerFrederic Guillot <fred@kanboard.net>2015-04-06 18:41:51 -0400
commit13ea77f018cebbf0a3b0457d4806cd6b8b5614e1 (patch)
tree30357f6ddd6eb186d599ba49f77f029e2bff72d7 /app/Subscriber
parentb89a4ac33f53677f18d641d73a97629f340fca7e (diff)
Fix bug with notifications and subtask restriction
Diffstat (limited to 'app/Subscriber')
-rw-r--r--app/Subscriber/NotificationSubscriber.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/app/Subscriber/NotificationSubscriber.php b/app/Subscriber/NotificationSubscriber.php
index 94815b56..09ca7625 100644
--- a/app/Subscriber/NotificationSubscriber.php
+++ b/app/Subscriber/NotificationSubscriber.php
@@ -47,10 +47,13 @@ class NotificationSubscriber extends Base implements EventSubscriberInterface
public function execute(GenericEvent $event, $event_name)
{
$values = $this->getTemplateData($event);
- $users = $this->notification->getUsersList($values['task']['project_id']);
- if (! empty($users)) {
- $this->notification->sendEmails($this->templates[$event_name], $users, $values);
+ if (isset($values['task']['project_id'])) {
+ $users = $this->notification->getUsersList($values['task']['project_id']);
+
+ if (! empty($users)) {
+ $this->notification->sendEmails($this->templates[$event_name], $users, $values);
+ }
}
}
@@ -64,11 +67,11 @@ class NotificationSubscriber extends Base implements EventSubscriberInterface
break;
case 'Event\SubtaskEvent':
$values['subtask'] = $this->subtask->getById($event['id'], true);
- $values['task'] = $this->taskFinder->getDetails($event['task_id']);
+ $values['task'] = $this->taskFinder->getDetails($values['subtask']['task_id']);
break;
case 'Event\FileEvent':
$values['file'] = $event->getAll();
- $values['task'] = $this->taskFinder->getDetails($event['task_id']);
+ $values['task'] = $this->taskFinder->getDetails($values['file']['task_id']);
break;
case 'Event\CommentEvent':
$values['comment'] = $this->comment->getById($event['id']);