diff --git a/modules/json_form_widget/src/WidgetRouter.php b/modules/json_form_widget/src/WidgetRouter.php index 6ed9f564dd..e1d2113880 100644 --- a/modules/json_form_widget/src/WidgetRouter.php +++ b/modules/json_form_widget/src/WidgetRouter.php @@ -179,9 +179,8 @@ public function getDropdownElement($element, $spec, $titleProperty = FALSE) { $element = $this->handleSelectOtherDefaultValue($element, $element['#options']); $element['#input_type'] = isset($spec->other_type) ? $spec->other_type : 'textfield'; } - if (!isset($element['#other_option'])) { - $element['#other_option'] = ''; - } + $element['#other_option'] = isset($element['#other_option']) ? $element['#other_option'] : FALSE; + if ($element['#type'] === 'select2') { $element['#multiple'] = isset($spec->multiple) ? TRUE : FALSE; $element['#autocreate'] = isset($spec->allowCreate) ? TRUE : FALSE;