From 45c59ff24298b4fe1546ae3f4d17fe6ced830e2a Mon Sep 17 00:00:00 2001 From: yuri Date: Tue, 26 May 2015 11:30:25 +0300 Subject: [PATCH] fix createRelated --- application/Espo/Services/Notification.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/application/Espo/Services/Notification.php b/application/Espo/Services/Notification.php index 7359fbfa53..e2825e443f 100644 --- a/application/Espo/Services/Notification.php +++ b/application/Espo/Services/Notification.php @@ -143,6 +143,12 @@ class Notification extends \Espo\Core\Services\Base $note->set('parentName', $parent->get('name')); } } + if ($note->get('relatedId') && $note->get('relatedType')) { + $related = $this->getEntityManager()->getEntity($note->get('relatedType'), $note->get('relatedId')); + if ($related) { + $note->set('relatedName', $related->get('name')); + } + } $entity->set('noteData', $note->toArray()); } else { unset($collection[$k]);