mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 07:12:26 +02:00
N°9525 - TagSet Errors
This commit is contained in:
@@ -213,7 +213,7 @@ abstract class AttributeSet extends AttributeDBFieldVoid
|
||||
* force an allowed value (type conversion and possibly forces a value as mySQL would do upon writing!
|
||||
*
|
||||
* @param $proposedValue
|
||||
* @param DBObject $oHostObj
|
||||
* @param DBObject|null $oHostObj
|
||||
*
|
||||
* @param bool $bIgnoreErrors
|
||||
*
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
namespace Combodo\iTop\Core\AttributeDefinition;
|
||||
|
||||
use ApplicationContext;
|
||||
use cmdbAbstractObject;
|
||||
use CoreException;
|
||||
use CoreUnexpectedValue;
|
||||
use CoreWarning;
|
||||
@@ -534,21 +536,21 @@ HTML;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $value
|
||||
* @param $sValue
|
||||
* @param DBObject $oHostObject
|
||||
* @param bool $bLocalize
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
*/
|
||||
public function GetAsXML($value, $oHostObject = null, $bLocalize = true)
|
||||
public function GetAsXML($sValue, $oHostObject = null, $bLocalize = true)
|
||||
{
|
||||
if (is_object($value) && ($value instanceof ormTagSet)) {
|
||||
if (is_object($sValue) && ($sValue instanceof ormTagSet)) {
|
||||
$sRes = "<Set>\n";
|
||||
if ($bLocalize) {
|
||||
$aValues = $value->GetLabels();
|
||||
$aValues = $sValue->GetLabels();
|
||||
} else {
|
||||
$aValues = $value->GetValues();
|
||||
$aValues = $sValue->GetValues();
|
||||
}
|
||||
if (!empty($aValues)) {
|
||||
$sRes .= '<Tag>'.implode('</Tag><Tag>', $aValues).'</Tag>';
|
||||
@@ -636,7 +638,7 @@ HTML;
|
||||
public function FromJSONToValue($json)
|
||||
{
|
||||
$oSet = new ormTagSet($this->GetHostClass(), $this->GetCode(), $this->GetMaxItems());
|
||||
$oSet->SetValues($json);
|
||||
$oSet->SetValues(json_decode($json, true));
|
||||
|
||||
return $oSet;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user