FIX inert of extra field must not change extrafield values in memory

This commit is contained in:
Laurent Destailleur 2017-09-03 12:40:49 +02:00
parent 3108f5bf0d
commit 3126676ffb

View File

@ -4294,7 +4294,7 @@ abstract class CommonObject
}
elseif ($value=='')
{
$this->array_options[$key] = null;
$new_array_options[$key] = null;
}
break;
/*case 'select': // Not required, we chosed value='0' for undefined values
@ -4304,13 +4304,13 @@ abstract class CommonObject
}
break;*/
case 'price':
$this->array_options[$key] = price2num($this->array_options[$key]);
$new_array_options[$key] = price2num($this->array_options[$key]);
break;
case 'date':
$this->array_options[$key]=$this->db->idate($this->array_options[$key]);
$new_array_options[$key] = $this->db->idate($this->array_options[$key]);
break;
case 'datetime':
$this->array_options[$key]=$this->db->idate($this->array_options[$key]);
$new_array_options[$key] = $this->db->idate($this->array_options[$key]);
break;
case 'link':
$param_list=array_keys($attributeParam ['options']);
@ -4326,7 +4326,7 @@ abstract class CommonObject
if (is_numeric($value)) $res=$object->fetch($value);
else $res=$object->fetch('',$value);
if ($res > 0) $this->array_options[$key]=$object->id;
if ($res > 0) $new_array_options[$key]=$object->id;
else
{
$this->error="Ref '".$value."' for object '".$object->element."' not found";
@ -4366,9 +4366,9 @@ abstract class CommonObject
// Add field o fattribut
if($extrafields->attribute_type[$attributeKey] != 'separate') // Only for other type of separate)
{
if ($this->array_options[$key] != '')
if ($new_array_options[$key] != '')
{
$sql.=",'".$this->db->escape($this->array_options[$key])."'";
$sql.=",'".$this->db->escape($new_array_options[$key])."'";
}
else
{