Properly display linksets with undefined external keys

SVN:trunk[612]
This commit is contained in:
Denis Flaven
2010-07-16 16:10:14 +00:00
parent 8875fc3e11
commit 3ddf8e8a3b

View File

@@ -213,7 +213,7 @@ class UILinksWidget
foreach($aObject as $sAttCode => $value)
{
$oAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
if ($oAttDef->IsExternalKey())
if ($oAttDef->IsExternalKey() && ($value != 0))
{
$oTargetObj = MetaModel::GetObject($oAttDef->GetTargetClass(), $value); // @@ optimization, don't do & query per object in the set !
$oObj->Set($sAttCode, $oTargetObj);