Merge pull request #15072 from FHenry/12.0_fix_14649

FIX #14649
This commit is contained in:
Laurent Destailleur 2020-10-22 15:51:31 +02:00 committed by GitHub
commit 5a52534675
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7186,7 +7186,7 @@ abstract class CommonObject
// HTML, select, integer and text add default value
if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('html', 'text', 'select', 'int')))
{
if ($action == 'create') $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix) ? GETPOST($keyprefix.'options_'.$key.$keysuffix, 'none', 3) : $extrafields->attributes[$this->table_element]['default'][$key];
if ($action == 'create') $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix) ? GETPOST($keyprefix.'options_'.$key.$keysuffix, 'none', 3) : ($this->array_options['options_'.$key] ? $this->array_options['options_'.$key] : $extrafields->attributes[$this->table_element]['default'][$key]);
else $value = $this->array_options['options_'.$key];
}