diff --git a/application/Espo/Hooks/Common/Notifications.php b/application/Espo/Hooks/Common/Notifications.php index 6105bc8d34..c8da1c4924 100644 --- a/application/Espo/Hooks/Common/Notifications.php +++ b/application/Espo/Hooks/Common/Notifications.php @@ -95,7 +95,7 @@ class Notifications extends \Espo\Core\Hooks\Base public function afterSave(Entity $entity, array $options = array()) { - if (!empty($options['silent']) && !empty($options['noNotifications'])) { + if (!empty($options['silent']) || !empty($options['noNotifications'])) { return; } @@ -111,7 +111,7 @@ class Notifications extends \Espo\Core\Hooks\Base public function beforeRemove(Entity $entity, array $options = array()) { - if (!empty($options['silent']) && !empty($options['noNotifications'])) { + if (!empty($options['silent']) || !empty($options['noNotifications'])) { return; } diff --git a/application/Espo/Hooks/Common/Stream.php b/application/Espo/Hooks/Common/Stream.php index d337990ad2..05057c29cb 100644 --- a/application/Espo/Hooks/Common/Stream.php +++ b/application/Espo/Hooks/Common/Stream.php @@ -180,7 +180,7 @@ class Stream extends \Espo\Core\Hooks\Base $this->getStreamService()->followEntityMass($entity, $userIdList); } - if (empty($options['noStream'])) { + if (empty($options['noStream']) && empty($options['silent'])) { $this->getStreamService()->noteCreate($entity); } @@ -211,7 +211,7 @@ class Stream extends \Espo\Core\Hooks\Base } } else { - if (empty($options['noStream'])) { + if (empty($options['noStream']) && empty($options['silent'])) { if ($entity->isFieldChanged('assignedUserId')) { $assignedUserId = $entity->get('assignedUserId'); if (!empty($assignedUserId)) { @@ -239,7 +239,7 @@ class Stream extends \Espo\Core\Hooks\Base } - if ($entity->isNew() && empty($options['noStream']) && $this->getMetadata()->get("scopes.{$entityName}.tab")) { + if ($entity->isNew() && empty($options['noStream']) && empty($options['silent']) && $this->getMetadata()->get("scopes.{$entityName}.tab")) { $this->handleCreateRelated($entity); } }