mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 23:16:03 +00:00
load parent fields fix
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user