From 59b574742b1f18ab6159e96eff8a06cd4d8a8d06 Mon Sep 17 00:00:00 2001 From: Matt Sidnell <54064522+pstructures@users.noreply.github.com> Date: Mon, 20 Apr 2020 22:52:36 +0100 Subject: [PATCH] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f881a89c204..83de743931c 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7124,7 +7124,14 @@ abstract class CommonObject 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'))) + { + if($action=='create') $value = $extrafields->attributes[$this->table_element]['default'][$key]; + else $value = $this->array_options['options_'.$key]; + } + $labeltoshow = $langs->trans($label); $helptoshow = $langs->trans($extrafields->attributes[$this->table_element]['help'][$key]);