Update commonobject.class.php

This commit is contained in:
Matt Sidnell 2020-04-20 22:52:36 +01:00
parent ea9f0097a2
commit 59b574742b

View File

@ -7125,6 +7125,13 @@ abstract class CommonObject
else $value = $this->array_options['options_'.$key]; else $value = $this->array_options['options_'.$key];
} }
// select fields use default value
if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('select')))
{
if($action=='create') $value = $extrafields->attributes[$this->table_element]['default'][$key];
else $value = $this->array_options['options_'.$key];
}
$labeltoshow = $langs->trans($label); $labeltoshow = $langs->trans($label);
$helptoshow = $langs->trans($extrafields->attributes[$this->table_element]['help'][$key]); $helptoshow = $langs->trans($extrafields->attributes[$this->table_element]['help'][$key]);