From 3f42bfb40f614d1e69454226502947ee6bf3045d Mon Sep 17 00:00:00 2001 From: mattsidnell Date: Mon, 20 Apr 2020 23:42:12 +0100 Subject: [PATCH] change --- htdocs/core/class/commonobject.class.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 83de743931c..02445a218c1 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7117,16 +7117,9 @@ abstract class CommonObject { $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix) ?price2num(GETPOST($keyprefix.'options_'.$key.$keysuffix, 'alpha', 3)) : $this->array_options['options_'.$key]; } - - // HTML and text add default value - if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('html', 'text'))) - { - if($action=='create') $value = $extrafields->attributes[$this->table_element]['default'][$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'))) + + // 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 = $extrafields->attributes[$this->table_element]['default'][$key]; else $value = $this->array_options['options_'.$key];