diff --git a/application/Espo/Tools/FieldManager/FieldManager.php b/application/Espo/Tools/FieldManager/FieldManager.php index 3aefc5c98f..0c10a697a7 100644 --- a/application/Espo/Tools/FieldManager/FieldManager.php +++ b/application/Espo/Tools/FieldManager/FieldManager.php @@ -145,9 +145,7 @@ class FieldManager ); } - $existingField = $this->getFieldDefs($scope, $name); - - if (isset($existingField)) { + if ($this->metadata->get("entityDefs.$scope.fields.$name")) { throw Conflict::createWithBody( "Field '$name' already exists in '$scope'.", Error\Body::create() @@ -159,7 +157,7 @@ class FieldManager ); } - if ($this->metadata->get(['entityDefs', $scope, 'links', $name])) { + if ($this->metadata->get("entityDefs.$scope.links.$name")) { throw Conflict::createWithBody( "Link with name '$name' already exists in '$scope'.", Error\Body::create()