diff --git a/application/Espo/Core/FieldProcessing/LinkParent/Loader.php b/application/Espo/Core/FieldProcessing/LinkParent/Loader.php index fb6d7eae68..4f6026f6ed 100644 --- a/application/Espo/Core/FieldProcessing/LinkParent/Loader.php +++ b/application/Espo/Core/FieldProcessing/LinkParent/Loader.php @@ -79,12 +79,6 @@ class Loader implements LoaderInterface $name = $fieldDefs->getName(); - if (!$entityDefs->hasRelation($fieldDefs->getName())) { - // Otherwise, loadParentNameField produces an error. - // @todo Revise. - continue; - } - $list[] = $name; } diff --git a/application/Espo/Core/ORM/Entity.php b/application/Espo/Core/ORM/Entity.php index 95f1a38847..37ff788220 100644 --- a/application/Espo/Core/ORM/Entity.php +++ b/application/Espo/Core/ORM/Entity.php @@ -31,6 +31,7 @@ namespace Espo\Core\ORM; use Espo\ORM\BaseEntity; use Espo\ORM\Query\Part\Order; +use Espo\ORM\Type\AttributeType; use Espo\ORM\Type\RelationType; use LogicException; @@ -64,10 +65,8 @@ class Entity extends BaseEntity */ public function hasLinkParentField(string $field): bool { - return - $this->getAttributeType($field . 'Type') == 'foreignType' && - $this->hasAttribute($field . 'Id') && - $this->hasRelation($field); + return $this->getAttributeType($field . 'Type') === AttributeType::FOREIGN_TYPE && + $this->hasAttribute($field . 'Id'); } /**