Skip to content

Commit

Permalink
FIX #8858 #8860 Backport better compatibility fix
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed May 29, 2018
1 parent bf81b75 commit 7eea70e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion htdocs/core/class/commonobject.class.php
Expand Up @@ -5810,7 +5810,12 @@ function showOptionals($extrafields, $mode='view', $params=null, $keysuffix='',
// 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')))
Expand Down

1 comment on commit 7eea70e

@altairis-tof
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this fix, i was about to submit a PR too. I hope a 7.0.3 will be released soon because at the moment with 7.0.2, datetime extrafields are not displayed although it was working before.

Please sign in to comment.