瀏覽代碼

Bug fix: display an empty string for the friendlyname of a NULL external key

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@2418 a333f486-631f-4898-b8df-5754b55c2be0
romainq 12 年之前
父節點
當前提交
313404a791
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      application/cmdbabstract.class.inc.php

+ 8 - 0
application/cmdbabstract.class.inc.php

@@ -1149,6 +1149,14 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay
 						else
 						{
 							$rawValue = $oObj->Get($sAttCodeEx);
+							if ($oAttDef instanceof AttributeFriendlyName)
+							{
+								$sKeyAttCode = $oAttDef->GetKeyAttCode();
+								if ($oObj->Get($sKeyAttCode) == 0)
+								{
+									$rawValue = '';
+								}
+							}
 							if ($bLocalize)
 							{
 								$outputValue = htmlentities($oFinalAttDef->GetValueLabel($rawValue), ENT_QUOTES, 'UTF-8');