From 96f5e55cc01566b471005b2f49e2aa7a80f13083 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Sat, 7 Sep 2024 09:49:18 +0300 Subject: [PATCH] ref --- application/Espo/Tools/FieldManager/FieldManager.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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()