Fix default value for boolean extrafield

This commit is contained in:
Maxime Kohlhaas 2022-05-21 15:41:34 +02:00
parent 1196d6f48c
commit 4932f86a2d

View File

@ -7518,7 +7518,7 @@ abstract class CommonObject
}
// HTML, text, select, integer and varchar: take into account default value in database if in create mode
if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('html', 'text', 'varchar', 'select', 'int'))) {
if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('html', 'text', 'varchar', 'select', 'int', 'boolean'))) {
if ($action == 'create') {
$value = (GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix) || $value) ? $value : $extrafields->attributes[$this->table_element]['default'][$key];
}