FIX #8858 #8860 Backport better compatibility fix

This commit is contained in:
Laurent Destailleur 2018-05-29 10:13:34 +02:00
parent bf81b755f9
commit 7eea70ebc8

View File

@ -5810,7 +5810,12 @@ abstract class CommonObject
// Convert date into timestamp format (value in memory must be a timestamp)
if (in_array($extrafields->attribute_type[$key],array('date','datetime')))
{
$value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)?dol_mktime(GETPOST($keyprefix.'options_'.$key.$keysuffix."hour", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."min",'int',3), 0, GETPOST($keyprefix.'options_'.$key.$keysuffix."month",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."day",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."year",'int',3)):$this->db->jdate($this->array_options['options_'.$key]);
$datenotinstring = $this->array_options['options_' . $key];
if (! is_numeric($this->array_options['options_' . $key])) // For backward compatibility
{
$datenotinstring = $this->db->jdate($datenotinstring);
}
$value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)?dol_mktime(GETPOST($keyprefix.'options_'.$key.$keysuffix."hour", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."min",'int',3), 0, GETPOST($keyprefix.'options_'.$key.$keysuffix."month",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."day",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."year",'int',3)):$datenotinstring;
}
// 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')))