diff --git a/application/Espo/Modules/Crm/Services/Meeting.php b/application/Espo/Modules/Crm/Services/Meeting.php index f8be49b6f8..67ceccbbb8 100644 --- a/application/Espo/Modules/Crm/Services/Meeting.php +++ b/application/Espo/Modules/Crm/Services/Meeting.php @@ -56,6 +56,8 @@ class Meeting extends \Espo\Services\Record protected $exportSkipFieldList = ['duration']; + protected $duplicateIgnoreAttributeList = ['usersColumns', 'contactsColumns', 'leadsColumns']; + protected function getMailSender() { return $this->getInjection('container')->get('mailSender'); diff --git a/application/Espo/Services/Record.php b/application/Espo/Services/Record.php index 081ebacf54..a2ab438706 100644 --- a/application/Espo/Services/Record.php +++ b/application/Espo/Services/Record.php @@ -122,6 +122,10 @@ class Record extends \Espo\Core\Services\Base protected $findDuplicatesSelectAttributeList = ['id', 'name']; + protected $duplicateIgnoreFieldList = []; + + protected $duplicateIgnoreAttributeList = []; + const MAX_SELECT_TEXT_ATTRIBUTE_LENGTH = 5000; const FOLLOWERS_LIMIT = 4; @@ -2426,15 +2430,12 @@ class Record extends \Espo\Core\Services\Base $attributes = $entity->getValueMap(); unset($attributes->id); - $fields = $this->getMetadata()->get(['entityDefs', $this->getEntityType(), 'fields'], array()); + $fields = $this->getMetadata()->get(['entityDefs', $this->getEntityType(), 'fields'], []); $fieldManager = new \Espo\Core\Utils\FieldManagerUtil($this->getMetadata()); foreach ($fields as $field => $item) { - if (empty($item['type'])) continue; - $type = $item['type']; - - if (!empty($item['duplicateIgnore'])) { + if (!empty($item['duplicateIgnore']) || in_array($field, $this->duplicateIgnoreFieldList)) { $attributeToIgnoreList = $fieldManager->getAttributeList($this->entityType, $field); foreach ($attributeToIgnoreList as $attribute) { unset($attributes->$attribute); @@ -2442,6 +2443,9 @@ class Record extends \Espo\Core\Services\Base continue; } + if (empty($item['type'])) continue; + $type = $item['type']; + if (in_array($type, ['file', 'image'])) { $attachment = $entity->get($field); if ($attachment) { @@ -2483,6 +2487,10 @@ class Record extends \Espo\Core\Services\Base } } + foreach ($this->duplicateIgnoreAttributeList as $attribute) { + unset($attributes->$attribute); + } + $attributes->_duplicatingEntityId = $id; return $attributes;