diff --git a/application/Espo/Modules/Crm/Services/Contact.php b/application/Espo/Modules/Crm/Services/Contact.php index 2f0e366da2..e6d57dd95d 100644 --- a/application/Espo/Modules/Crm/Services/Contact.php +++ b/application/Espo/Modules/Crm/Services/Contact.php @@ -43,11 +43,10 @@ class Contact extends \Espo\Core\Templates\Services\Person 'title' ]; - public function afterCreate(Entity $entity, array $data = array()) + protected function afterCreateEntity(Entity $entity, $data) { - parent::afterCreate($entity, $data); - if (!empty($data['emailId'])) { - $email = $this->getEntityManager()->getEntity('Email', $data['emailId']); + if (!empty($data->emailId)) { + $email = $this->getEntityManager()->getEntity('Email', $data->emailId); if ($email && !$email->get('parentId')) { if ($this->getConfig()->get('b2cMode')) { $email->set(array( diff --git a/application/Espo/Modules/Crm/Services/Lead.php b/application/Espo/Modules/Crm/Services/Lead.php index 2ef91bca6f..f687f6cc64 100644 --- a/application/Espo/Modules/Crm/Services/Lead.php +++ b/application/Espo/Modules/Crm/Services/Lead.php @@ -48,11 +48,10 @@ class Lead extends \Espo\Core\Templates\Services\Person return $this->getInjection('container')->get('fieldManager'); } - public function afterCreate(Entity $entity, array $data = array()) + protected function afterCreateEntity(Entity $entity, $data) { - parent::afterCreate($entity, $data); - if (!empty($data['emailId'])) { - $email = $this->getEntityManager()->getEntity('Email', $data['emailId']); + if (!empty($data->emailId)) { + $email = $this->getEntityManager()->getEntity('Email', $data->emailId); if ($email && !$email->get('parentId')) { $email->set(array( 'parentType' => 'Lead', diff --git a/application/Espo/Services/Portal.php b/application/Espo/Services/Portal.php index 5cf4964cec..8791b27ec0 100644 --- a/application/Espo/Services/Portal.php +++ b/application/Espo/Services/Portal.php @@ -47,9 +47,8 @@ class Portal extends Record $this->loadUrlField($entity); } - protected function afterUpdate(Entity $entity, array $data = array()) + protected function afterUpdateEntity(Entity $entity, $data) { - parent::afterUpdate($entity, $data); $this->loadUrlField($entity); }