From c2bb0431f0b0f390a3d8263d6e57504dce29623c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 3 Aug 2020 12:31:30 +0200 Subject: [PATCH] FIX input field of extrafields must keep data if form submit fails. --- htdocs/core/class/commonobject.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 3359dcb9a64..9894d2e6c64 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7048,7 +7048,7 @@ abstract class CommonObject if (is_array($extrafields->attributes[$this->table_element]['label']) && count($extrafields->attributes[$this->table_element]['label']) > 0) { $out .= "\n"; - $out .= ' '; + $out .= ' '; $out .= "\n"; $extrafields_collapse_num = ''; @@ -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 = $extrafields->attributes[$this->table_element]['default'][$key]; + if ($action == 'create') $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix) ? GETPOST($keyprefix.'options_'.$key.$keysuffix, 'none', 3) : $extrafields->attributes[$this->table_element]['default'][$key]; else $value = $this->array_options['options_'.$key]; } @@ -7270,7 +7270,7 @@ abstract class CommonObject setListDependencies(); }); '."\n"; - $out .= ' '."\n"; + $out .= ' '."\n"; } } return $out;