Skip to content

Commit 596ea0b

Browse files
committed
N°8528 - ignore silo not applied on 1:n linkedset displayed in form in portal
1 parent 0fe2183 commit 596ea0b

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

core/ormlinkset.class.inc.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ protected function GetArrayOfIndex()
232232
{
233233
$aRet = array();
234234
$this->oOriginalSet->Rewind();
235+
$this->oOriginalSet->OptimizeColumnLoad([$this->sClass => []]);
235236
$iRow = 0;
236237
while ($oObject = $this->oOriginalSet->Fetch())
237238
{
@@ -321,8 +322,6 @@ public function Seek($iPosition): void
321322
*/
322323
public function Fetch()
323324
{
324-
$this->LoadOriginalIds();
325-
326325
$ret = $this->current();
327326
if ($ret === false)
328327
{
@@ -353,7 +352,7 @@ public function current()
353352
if ($this->iCursor < $iPreservedCount)
354353
{
355354
$sId = key($this->aPreserved);
356-
$oRet = MetaModel::GetObject($this->sClass, $sId);
355+
$oRet = MetaModel::GetObject($this->sClass, $sId, true, true);
357356
}
358357
else
359358
{

sources/Core/AttributeDefinition/AttributeLinkedSet.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use CMDBSource;
1010
use Combodo\iTop\Application\UI\Links\Set\BlockLinkSetDisplayAsProperty;
1111
use Combodo\iTop\Form\Field\LinkedSetField;
12+
use Combodo\iTop\Portal\Helper\ScopeValidatorHelper;
1213
use Combodo\iTop\Renderer\Console\ConsoleBlockRenderer;
1314
use Combodo\iTop\Service\Links\LinkSetModel;
1415
use CoreException;
@@ -21,6 +22,7 @@
2122
use ExceptionLog;
2223
use IssueLog;
2324
use MetaModel;
25+
use ModuleDesign;
2426
use ormLinkSet;
2527
use ValueSetObjects;
2628

@@ -154,6 +156,14 @@ public function GetDefaultValue(DBObject $oHostObject = null)
154156
$oLinkSearch->AddCondition_PointingTo($oRemoteSearch, $this->GetExtKeyToRemote());
155157
}
156158
}
159+
//Add silo in portal context
160+
if (defined('PORTAL_ID'))
161+
{
162+
$oModuleDesign = new ModuleDesign(PORTAL_ID);
163+
$oScopeValidatorHelper = new ScopeValidatorHelper($oModuleDesign, PORTAL_ID);
164+
$oScopeValidatorHelper->AddScopeToQuery($oLinkSearch, $oLinkSearch->GetClass());
165+
}
166+
157167
$oLinks = new DBObjectSet($oLinkSearch);
158168
$oLinkSet = new ormLinkSet($this->GetHostClass(), $this->GetCode(), $oLinks);
159169

0 commit comments

Comments
 (0)