From 6929b2d717f3b8a5a930faaadc178a48e3825b07 Mon Sep 17 00:00:00 2001 From: yuri Date: Mon, 10 Sep 2018 15:24:42 +0300 Subject: [PATCH] mass update skipStreamNotesAcl --- application/Espo/Hooks/Common/StreamNotesAcl.php | 2 ++ application/Espo/Services/Record.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/application/Espo/Hooks/Common/StreamNotesAcl.php b/application/Espo/Hooks/Common/StreamNotesAcl.php index 2009ee441f..0f66551979 100644 --- a/application/Espo/Hooks/Common/StreamNotesAcl.php +++ b/application/Espo/Hooks/Common/StreamNotesAcl.php @@ -59,6 +59,8 @@ class StreamNotesAcl extends \Espo\Core\Hooks\Base if (!empty($options['noStream'])) return; if (!empty($options['silent'])) return; + if (!empty($options['skipStreamNotesAcl'])) return; + if ($entity->isNew()) return; $entityType = $entity->getEntityType(); diff --git a/application/Espo/Services/Record.php b/application/Espo/Services/Record.php index 72c8e86767..2b6e4340a0 100644 --- a/application/Espo/Services/Record.php +++ b/application/Espo/Services/Record.php @@ -1328,7 +1328,7 @@ class Record extends \Espo\Core\Services\Base if ($this->getAcl()->check($entity, 'edit') && $this->checkEntityForMassUpdate($entity, $data)) { $entity->set($data); if ($this->checkAssignment($entity)) { - if ($repository->save($entity)) { + if ($repository->save($entity, ['massUpdate' => true])) { $idsUpdated[] = $entity->id; $count++; @@ -1366,7 +1366,7 @@ class Record extends \Espo\Core\Services\Base if ($this->getAcl()->check($entity, 'edit') && $this->checkEntityForMassUpdate($entity, $data)) { $entity->set($data); if ($this->checkAssignment($entity)) { - if ($repository->save($entity)) { + if ($repository->save($entity, ['massUpdate' => true, 'skipStreamNotesAcl' => true])) { $idsUpdated[] = $entity->id; $count++;