From 20f97caab39c5b485fa2498e976dfd7f08e3c4f7 Mon Sep 17 00:00:00 2001 From: yuri Date: Wed, 10 May 2017 12:36:50 +0300 Subject: [PATCH] field manager: not allow name same as link --- application/Espo/Core/Utils/FieldManager.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/application/Espo/Core/Utils/FieldManager.php b/application/Espo/Core/Utils/FieldManager.php index 8e5278ce6b..dd17ae2e3c 100644 --- a/application/Espo/Core/Utils/FieldManager.php +++ b/application/Espo/Core/Utils/FieldManager.php @@ -99,6 +99,9 @@ class FieldManager if (isset($existingField)) { throw new Conflict('Field ['.$name.'] exists in '.$scope); } + if ($this->getMetadata()->get(['entityDefs', $scope, 'links', $name])) { + throw new Conflict('Link with name ['.$name.'] exists in '.$scope); + } if (in_array($name, $this->forbiddenFieldNameList)) { throw new Conflict('Field ['.$name.'] is not allowed'); }