summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--app/Notification/MailNotification.php2
-rw-r--r--tests/units/Notification/MailNotificationTest.php5
3 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 1ef7ebd3..a559b4ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,10 @@ Improvements:
* Show project name in task forms
* Convert vanilla CSS to SASS
+Bug fixes:
+
+* Fix PHP notice when sending overdue notifications
+
Version 1.0.32
--------------
diff --git a/app/Notification/MailNotification.php b/app/Notification/MailNotification.php
index a5f51b89..9e042820 100644
--- a/app/Notification/MailNotification.php
+++ b/app/Notification/MailNotification.php
@@ -80,7 +80,7 @@ class MailNotification extends Base implements NotificationInterface
{
return sprintf(
'[%s] %s',
- $eventData['task']['project_name'],
+ isset($eventData['project_name']) ? $eventData['project_name'] : $eventData['task']['project_name'],
$this->notificationModel->getTitleWithoutAuthor($eventName, $eventData)
);
}
diff --git a/tests/units/Notification/MailNotificationTest.php b/tests/units/Notification/MailNotificationTest.php
index 05f1f882..93eeef0c 100644
--- a/tests/units/Notification/MailNotificationTest.php
+++ b/tests/units/Notification/MailNotificationTest.php
@@ -58,6 +58,11 @@ class MailNotificationTest extends Base
$this->assertNotEmpty($mailNotification->getMailContent($eventName, $eventData));
$this->assertStringStartsWith('[test] ', $mailNotification->getMailSubject($eventName, $eventData));
}
+
+ $this->assertStringStartsWith('[Test1, Test2] ', $mailNotification->getMailSubject(TaskModel::EVENT_OVERDUE, array(
+ 'tasks' => array(array('id' => 123), array('id' => 456)),
+ 'project_name' => 'Test1, Test2',
+ )));
}
public function testSendWithEmailAddress()