浏览代码

- fixed bug #52 (display of lnkInfraError objects) by adding a protection in GetDisplayName against objects that actually do not have any name.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@203 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 15 年之前
父节点
当前提交
e59bbf56f4
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      application/cmdbabstract.class.inc.php

+ 6 - 1
application/cmdbabstract.class.inc.php

@@ -189,7 +189,12 @@ abstract class cmdbAbstractObject extends CMDBObject
 
 	function GetDisplayName()
 	{
-		return $this->GetAsHTML(MetaModel::GetNameAttributeCode(get_class($this)));
+		$sDisplayName = '';
+		if (MetaModel::GetNameAttributeCode(get_class($this)) != '')
+		{
+			$sDisplayName = $this->GetAsHTML(MetaModel::GetNameAttributeCode(get_class($this)));
+		}
+		return $sDisplayName;
 	}
 
 	function GetBareDetails(web_page $oPage)