Browse Source

Fix of a regression introduced by [3146]: due to formatting rules, empty friendlynames may not look like empty strings!

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3172 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 11 years ago
parent
commit
c1afd414b3
2 changed files with 6 additions and 2 deletions
  1. 2 2
      application/cmdbabstract.class.inc.php
  2. 4 0
      webservices/export.php

+ 2 - 2
application/cmdbabstract.class.inc.php

@@ -1195,7 +1195,8 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay
 						else
 						{
 							$rawValue = $oObj->Get($sAttCodeEx);
-/*
+							// Due to custom formatting rules, empty friendlynames may be rendered as non-empty strings
+							// let's fix this and make sure we render an empty string if the key == 0
 							if ($oAttDef instanceof AttributeFriendlyName)
 							{
 								$sKeyAttCode = $oAttDef->GetKeyAttCode();
@@ -1207,7 +1208,6 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay
 									}
 								}
 							}
-*/
 							if ($bLocalize)
 							{
 								$outputValue = htmlentities($oFinalAttDef->GetEditValue($rawValue), ENT_QUOTES, 'UTF-8');

+ 4 - 0
webservices/export.php

@@ -152,6 +152,10 @@ if (!empty($sExpression))
 			{
 				$aAliasToFields[$sClassAlias][] = $oAttDef->GetParentAttCode();
 			}
+			else if($oAttDef instanceof AttributeFriendlyname)
+			{
+				$aAliasToFields[$sClassAlias][] = $oAttDef->GetKeyAttCode();
+			}
 		}
 
 		// Read query parameters