N°971 Portal: Fix Browse brick n:n level links in tree and mosaic display

This commit is contained in:
Stephen Abello
2019-11-26 11:35:14 +01:00
parent c0f82f25a3
commit ff3c7ebe54

View File

@@ -314,7 +314,16 @@ class BrowseBrickController extends BrickController
$oQuery = $aLevelsProperties[$aLevelProperties['levels'][0]]['search'];
if (!empty($sNodeId))
{
$oQuery->AddCondition($aLevelsProperties[$aLevelProperties['levels'][0]]['parent_att'], $sNodeId);
$sParentAttCode = $aLevelsProperties[$aLevelProperties['levels'][0]]['parent_att'];
$oParentAtt = MetaModel::GetAttributeDef($oQuery->GetClass(), $sParentAttCode);
if($oParentAtt instanceof \AttributeLinkedSetIndirect)
{
$oQuery->AddConditionAdvanced($sParentAttCode.'->'.$oParentAtt->GetExtKeyToRemote(), $sNodeId);
}
else
{
$oQuery->AddCondition($sParentAttCode, $sNodeId);
}
}
$bFoundLevel = true;
break;