diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php index db1620c0f..1dcfc8f64 100644 --- a/core/attributedef.class.inc.php +++ b/core/attributedef.class.inc.php @@ -9459,6 +9459,14 @@ class AttributeTable extends AttributeDBField { $value = @unserialize($aCols[$sPrefix.'']); if ($value === false) + { + $value = @json_decode($aCols[$sPrefix.''], true); + if (is_null($value)) + { + $value = false; + } + } + if ($value === false) { $value = $this->MakeRealValue($aCols[$sPrefix.''], null); } @@ -9473,7 +9481,15 @@ class AttributeTable extends AttributeDBField public function GetSQLValues($value) { $aValues = array(); - $aValues[$this->Get("sql")] = serialize($value); + try + { + $sSerializedValue = serialize($value); + } + catch (Exception $e) + { + $sSerializedValue = json_encode($value); + } + $aValues[$this->Get("sql")] = $sSerializedValue; return $aValues; }