- πΊπΈUnited States xpersonas
I can confirm this issue as well. I'm also curious if you guys have this issue?
https://www.drupal.org/project/select_or_other/issues/3463820 π Missing "None" Option on Checkbox/Radio Display Active
The "- None -" option in the "default value" area of a field's settings form seems to disappear when the "select or other" widget is enabled. This makes is impossible to save changes to the settings of a single select field without choosing a default value for the field. Can anyone else confirm this issue?
The only workaround I can find is to switch the widget back to the core select list widget, modify and save the field settings, then re-enable the "select or other" widget.
The problem seems related to the "#no_empty_option" value being set to 1 when the select or other module builds the widget in the context of a settings form.
By the time the following code in /select_or_other/src/Plugin/Field/FieldWidgetWidgetBase.php is called, the value of that variable is 1 rather than 0 or empty:
public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
$element += [
'#no_empty_option' => $this->isDefaultValueWidget($form_state),
'#type' => $this->getSetting('select_element_type'),
'#default_value' => $this->getSelectedOptions($items),
'#multiple' => $this->isMultiple(),
'#key_column' => $this->getColumn(),
'#other_placeholder' => $this->getSetting('other_placeholder'),
'#other_option' => $this->getSetting('other_option'),
'#other_field_label' => $this->getSetting('other_field_label'),
];
$element['#options'] = $this->getOptions($items->getEntity());
$element['#options'] = $this->sortOptions($element['#options']);
// The rest of the $element is built by child method implementations.
return $element;
}
Active
4.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
I can confirm this issue as well. I'm also curious if you guys have this issue?
https://www.drupal.org/project/select_or_other/issues/3463820
π
Missing "None" Option on Checkbox/Radio Display
Active