From b669ccf73323faa124b5bafb4eab93b5abf913eb Mon Sep 17 00:00:00 2001 From: yuri Date: Tue, 16 Jul 2019 10:22:26 +0300 Subject: [PATCH] fix portal isCustom undefined --- application/Espo/Repositories/Portal.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/application/Espo/Repositories/Portal.php b/application/Espo/Repositories/Portal.php index cd076e6534..ac3f0c0fce 100644 --- a/application/Espo/Repositories/Portal.php +++ b/application/Espo/Repositories/Portal.php @@ -50,11 +50,12 @@ class Portal extends \Espo\Core\ORM\Repositories\RDB { if ($entity->get('customUrl')) { $entity->set('url', $entity->get('customUrl')); - return; } + $siteUrl = $this->getConfig()->get('siteUrl'); $siteUrl = rtrim($siteUrl , '/') . '/'; $url = $siteUrl . 'portal/'; + if ($entity->id === $this->getConfig()->get('defaultPortalId')) { $entity->set('isDefault', true); $entity->setFetched('isDefault', true); @@ -67,7 +68,10 @@ class Portal extends \Espo\Core\ORM\Repositories\RDB $entity->set('isDefault', false); $entity->setFetched('isDefault', false); } - $entity->set('url', $url); + + if (!$entity->get('customUrl')) { + $entity->set('url', $url); + } } protected function afterSave(Entity $entity, array $options = array()) @@ -87,4 +91,3 @@ class Portal extends \Espo\Core\ORM\Repositories\RDB } } } -