FIX extrafields price and double were lost during a failed post.

This commit is contained in:
Laurent Destailleur 2018-04-23 22:53:57 +02:00
parent f95e5078c1
commit 0a5e606937

View File

@ -5783,9 +5783,9 @@ abstract class CommonObject
} else { } else {
$value = $this->array_options["options_" . $key]; // No GET, no POST, no default value, so we take value of object. $value = $this->array_options["options_" . $key]; // No GET, no POST, no default value, so we take value of object.
} }
//var_dump($keyprefix.' - '.$key.' - '.$keysuffix.' - '.$keyprefix.'options_'.$key.$keysuffix.' - '.$this->array_options["options_".$key.$keysuffix].' - '.$getposttemp.' - '.$value);
break; break;
} }
//var_dump($value);
if ($extrafields->attribute_type[$key] == 'separate') if ($extrafields->attribute_type[$key] == 'separate')
{ {
@ -5815,7 +5815,7 @@ abstract class CommonObject
// Convert float submited string into real php numeric (value in memory must be a php numeric) // Convert float submited string into real php numeric (value in memory must be a php numeric)
if (in_array($extrafields->attribute_type[$key],array('price','double'))) if (in_array($extrafields->attribute_type[$key],array('price','double')))
{ {
$value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)?price2num(GETPOST($keyprefix.'options_'.$key.$keysuffix,'int',3)):$this->array_options['options_'.$key]; $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)?price2num(GETPOST($keyprefix.'options_'.$key.$keysuffix, 'alpha', 3)):$this->array_options['options_'.$key];
} }
$labeltoshow = $langs->trans($label); $labeltoshow = $langs->trans($label);