EspoCRM – Open Source CRM Application
PHP calendarcontactscrmcrm-platformcrm-systemcustomer-portalcustomer-supportcustomizabledocumentsemail-marketingkanbanleadsopen-sourcephpplatformsales-automationsingle-page-applicationsupport
Duplicate ignore order
Yuriidfd48040f028
diff --git a/application/Espo/Core/Record/Duplicator/EntityDuplicator.php b/application/Espo/Core/Record/Duplicator/EntityDuplicator.phpindex 8134778614..4aeae5a93f 100644--- a/application/Espo/Core/Record/Duplicator/EntityDuplicator.php+++ b/application/Espo/Core/Record/Duplicator/EntityDuplicator.php@@ -60,6 +60,10 @@ class EntityDuplicator$entityDefs = $this->defs->getEntity($entityType);+ foreach ($entityDefs->getFieldList() as $fieldDefs) {+ $this->processIgnoreField($entity, $fieldDefs, $valueMap);+ }+foreach ($entityDefs->getFieldList() as $fieldDefs) {$this->processField($entity, $fieldDefs, $valueMap);}@@ -71,7 +75,7 @@ class EntityDuplicatorreturn $valueMap;}- private function processField(Entity $entity, FieldDefs $fieldDefs, stdClass $valueMap): void+ private function processIgnoreField(Entity $entity, FieldDefs $fieldDefs, stdClass $valueMap): void{$entityType = $entity->getEntityType();$field = $fieldDefs->getName();@@ -82,7 +86,15 @@ class EntityDuplicatorforeach ($attributeList as $attribute) {unset($valueMap->$attribute);}+ }+ }+ private function processField(Entity $entity, FieldDefs $fieldDefs, stdClass $valueMap): void+ {+ $entityType = $entity->getEntityType();+ $field = $fieldDefs->getName();++ if ($this->toIgnoreField($entityType, $fieldDefs)) {return;}