diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index 771f687d57..aa1b831551 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -1160,7 +1160,7 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay } if ($bLocalize) { - $outputValue = htmlentities($oFinalAttDef->GetValueLabel($rawValue), ENT_QUOTES, 'UTF-8'); + $outputValue = htmlentities($oFinalAttDef->GetEditValue($rawValue), ENT_QUOTES, 'UTF-8'); } else { diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php index 14de0f60ff..ab384bebfd 100644 --- a/core/attributedef.class.inc.php +++ b/core/attributedef.class.inc.php @@ -2286,7 +2286,11 @@ class AttributeEnum extends AttributeString public function GetAsXML($value, $oHostObject = null, $bLocalize = true) { - if ($bLocalize) + if (is_null($value)) + { + $sFinalValue = ''; + } + elseif ($bLocalize) { $sFinalValue = $this->GetValueLabel($value); } @@ -2300,7 +2304,11 @@ class AttributeEnum extends AttributeString public function GetAsCSV($sValue, $sSeparator = ',', $sTextQualifier = '"', $oHostObject = null, $bLocalize = true) { - if ($bLocalize) + if (is_null($sValue)) + { + $sFinalValue = ''; + } + elseif ($bLocalize) { $sFinalValue = $this->GetValueLabel($sValue); } @@ -2315,7 +2323,14 @@ class AttributeEnum extends AttributeString public function GetEditValue($sValue, $oHostObj = null) { - return $this->GetValueLabel($sValue); + if (is_null($sValue)) + { + return ''; + } + else + { + return $this->GetValueLabel($sValue); + } } public function GetAsHTMLForHistory($sOldValue, $sNewValue, $sLabel = null)