From 7dc43e5cccc0372f33ffed4e9e7e7457240926d6 Mon Sep 17 00:00:00 2001 From: yuri Date: Fri, 11 Dec 2015 12:50:23 +0200 Subject: [PATCH] entity class fixes --- application/Espo/Core/ORM/Entity.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/application/Espo/Core/ORM/Entity.php b/application/Espo/Core/ORM/Entity.php index 6de6e082fc..88dd79b5a7 100644 --- a/application/Espo/Core/ORM/Entity.php +++ b/application/Espo/Core/ORM/Entity.php @@ -130,9 +130,15 @@ class Entity extends \Espo\ORM\Entity if (!$this->hasField($idsField)) return null; if (!$this->has($idsField)) { - $this->loadLinkMultipleField($field, true); + if (!$this->isNew()) { + $this->loadLinkMultipleField($field, true); + } } - return $this->get($idsField); + $valueList = $this->get($idsField); + if (empty($valueList)) { + return []; + } + return $valueList; } public function hasLinkMultipleId($field, $id)