Ver código fonte

- 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 anos atrás
pai
commit
e59bbf56f4
1 arquivos alterados com 6 adições e 1 exclusões
  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)