From bb28500ef7d1d9e09a4a2300e3f069cf40f82e7a Mon Sep 17 00:00:00 2001 From: ralf Date: Fri, 5 Aug 2022 20:20:46 +0200 Subject: [PATCH] fix mail preferences could not be saved --- api/src/Etemplate/Widget/Select.php | 3 ++- preferences/inc/class.preferences_settings.inc.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/api/src/Etemplate/Widget/Select.php b/api/src/Etemplate/Widget/Select.php index d53b901284..c453326443 100644 --- a/api/src/Etemplate/Widget/Select.php +++ b/api/src/Etemplate/Widget/Select.php @@ -151,6 +151,7 @@ class Select extends Etemplate\Widget $widget_type = substr($widget_type, 4); } $multiple = $this->attrs['multiple'] || $this->getElementAttribute($form_name, 'multiple') || $this->getElementAttribute($form_name, 'rows') > 1; + $allowFreeEntries = $this->attrs['allowFreeEntries'] || $this->getElementAttribute($form_name, 'allowFreeEntries'); $ok = true; if (!$this->is_readonly($cname, $form_name)) @@ -178,7 +179,7 @@ class Select extends Etemplate\Widget if ((string)$val === '' && in_array('', $allowed)) continue; // no validation, for allowFreeEntries="true" - if (!empty($this->attrs['allowFreeEntries']) && $this->attrs['allowFreeEntries'] !== 'false') + if ($allowFreeEntries) { continue; } diff --git a/preferences/inc/class.preferences_settings.inc.php b/preferences/inc/class.preferences_settings.inc.php index 7db1c292c4..0f88815f0d 100644 --- a/preferences/inc/class.preferences_settings.inc.php +++ b/preferences/inc/class.preferences_settings.inc.php @@ -488,9 +488,9 @@ class preferences_settings if($setting['no_sel_options']) { $tpl->setElementAttribute($tab . '[' . $setting['name'] . ']', 'autocomplete_url', ''); + $tpl->setElementAttribute($tab . '[' . $setting['name'] . ']', 'allowFreeEntries', true); } $setting['type'] = 'et2-select'; - $setting['multiple'] = true; $tpl->setElementAttribute($tab . '[' . $setting['name'] . ']', 'multiple', true); break; }