Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions core/ormlinkset.class.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ protected function GetArrayOfIndex()
{
$aRet = array();
$this->oOriginalSet->Rewind();
$this->oOriginalSet->OptimizeColumnLoad([$this->sClass => []]);
$iRow = 0;
while ($oObject = $this->oOriginalSet->Fetch())
{
Expand Down Expand Up @@ -321,8 +322,6 @@ public function Seek($iPosition): void
*/
public function Fetch()
{
$this->LoadOriginalIds();

$ret = $this->current();
if ($ret === false)
{
Expand Down Expand Up @@ -353,7 +352,7 @@ public function current()
if ($this->iCursor < $iPreservedCount)
{
$sId = key($this->aPreserved);
$oRet = MetaModel::GetObject($this->sClass, $sId);
$oRet = MetaModel::GetObject($this->sClass, $sId, true, true);
}
else
{
Expand Down
10 changes: 10 additions & 0 deletions sources/Core/AttributeDefinition/AttributeLinkedSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use CMDBSource;
use Combodo\iTop\Application\UI\Links\Set\BlockLinkSetDisplayAsProperty;
use Combodo\iTop\Form\Field\LinkedSetField;
use Combodo\iTop\Portal\Helper\ScopeValidatorHelper;
use Combodo\iTop\Renderer\Console\ConsoleBlockRenderer;
use Combodo\iTop\Service\Links\LinkSetModel;
use CoreException;
Expand All @@ -21,6 +22,7 @@
use ExceptionLog;
use IssueLog;
use MetaModel;
use ModuleDesign;
use ormLinkSet;
use ValueSetObjects;

Expand Down Expand Up @@ -154,6 +156,14 @@ public function GetDefaultValue(DBObject $oHostObject = null)
$oLinkSearch->AddCondition_PointingTo($oRemoteSearch, $this->GetExtKeyToRemote());
}
}
//Add silo in portal context
if (defined('PORTAL_ID'))
{
$oModuleDesign = new ModuleDesign(PORTAL_ID);
$oScopeValidatorHelper = new ScopeValidatorHelper($oModuleDesign, PORTAL_ID);
$oScopeValidatorHelper->AddScopeToQuery($oLinkSearch, $oLinkSearch->GetClass());
}

$oLinks = new DBObjectSet($oLinkSearch);
$oLinkSet = new ormLinkSet($this->GetHostClass(), $this->GetCode(), $oLinks);

Expand Down