diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-08-15 20:46:26 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-08-15 20:46:26 -0400 |
commit | 5f82a942c0011bf91947b2c1d627c0907bda0c92 (patch) | |
tree | 31dfe2268e237d0fd7ea4586f9c25a365fb54116 | |
parent | 70104eff1599a46e00a907e8c185f63493f26ecd (diff) |
Fix PHP notice when sending overdue notifications
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | app/Notification/MailNotification.php | 2 | ||||
-rw-r--r-- | tests/units/Notification/MailNotificationTest.php | 5 |
3 files changed, 10 insertions, 1 deletions
@@ -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() |