From a86e3d42635701e94016124670baf465f6d511f9 Mon Sep 17 00:00:00 2001 From: Anne-Cath Date: Fri, 22 Nov 2024 11:32:03 +0100 Subject: [PATCH 1/3] =?UTF-8?q?N=C2=B06663=20-=20Request=20template=20fiel?= =?UTF-8?q?ds=20do=20not=20apply=20portal=20silos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FieldRenderer/BsSelectObjectFieldRenderer.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sources/Renderer/Bootstrap/FieldRenderer/BsSelectObjectFieldRenderer.php b/sources/Renderer/Bootstrap/FieldRenderer/BsSelectObjectFieldRenderer.php index b91d53dec0..b2ba3d384d 100644 --- a/sources/Renderer/Bootstrap/FieldRenderer/BsSelectObjectFieldRenderer.php +++ b/sources/Renderer/Bootstrap/FieldRenderer/BsSelectObjectFieldRenderer.php @@ -21,6 +21,7 @@ namespace Combodo\iTop\Renderer\Bootstrap\FieldRenderer; use ApplicationContext; +use Combodo\iTop\Portal\Helper\ScopeValidatorHelper; use Combodo\iTop\Renderer\RenderingOutput; use ContextTag; use CoreException; @@ -29,6 +30,7 @@ use Exception; use IssueLog; use MetaModel; +use ModuleDesign; use utils; /** @@ -104,7 +106,12 @@ public function Render() $oOutput->AddHtml(''); $oOutput->AddHtml(''); - // - Retrieving choices + + if (defined('PORTAL_ID')) + { + $oModuleDesign = new ModuleDesign(PORTAL_ID); + $oScopeValidatorHelper = new ScopeValidatorHelper( $oModuleDesign, PORTAL_ID); + $oScopeValidatorHelper->AddScopeToQuery($oSearch, $oSearch->GetClass()); + } + + // - Retrieving choices $sPortalId =$_ENV['PORTAL_ID']; $oModuleDesign = new ModuleDesign($_ENV['PORTAL_ID']); $oScopeValidatorHelper = new ScopeValidatorHelper( $oModuleDesign, $sPortalId); From 296ceb6026cfca202a0fa3e05b968e51185717eb Mon Sep 17 00:00:00 2001 From: Anne-Cath Date: Thu, 28 Nov 2024 14:52:42 +0100 Subject: [PATCH 3/3] Better fix --- .../Bootstrap/FieldRenderer/BsSelectObjectFieldRenderer.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sources/Renderer/Bootstrap/FieldRenderer/BsSelectObjectFieldRenderer.php b/sources/Renderer/Bootstrap/FieldRenderer/BsSelectObjectFieldRenderer.php index 0060a60910..ac47939c9d 100644 --- a/sources/Renderer/Bootstrap/FieldRenderer/BsSelectObjectFieldRenderer.php +++ b/sources/Renderer/Bootstrap/FieldRenderer/BsSelectObjectFieldRenderer.php @@ -113,12 +113,6 @@ public function Render() $oScopeValidatorHelper->AddScopeToQuery($oSearch, $oSearch->GetClass()); } - // - Retrieving choices - $sPortalId =$_ENV['PORTAL_ID']; - $oModuleDesign = new ModuleDesign($_ENV['PORTAL_ID']); - $oScopeValidatorHelper = new ScopeValidatorHelper( $oModuleDesign, $sPortalId); - $oScopeValidatorHelper->AddScopeToQuery($oSearch, $oSearch->GetClass()); - $oChoicesSet = new DBObjectSet($oSearch); $oChoicesSet->OptimizeColumnLoad(array($oSearch->GetClassAlias() => array('friendlyname'))); while ($oChoice = $oChoicesSet->Fetch())