Преглед изворни кода

- 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)