diff -u b/core/modules/options/lib/Drupal/options/Plugin/Field/FieldType/ListItemBase.php b/core/modules/options/lib/Drupal/options/Plugin/Field/FieldType/ListItemBase.php --- b/core/modules/options/lib/Drupal/options/Plugin/Field/FieldType/ListItemBase.php +++ b/core/modules/options/lib/Drupal/options/Plugin/Field/FieldType/ListItemBase.php @@ -134,13 +134,15 @@ // case of an alter changing #parents. $element['allowed_values']['#on_parents'] = &$element['allowed_values']['on']['#parents']; $element['allowed_values']['#off_parents'] = &$element['allowed_values']['off']['#parents']; + + // Provide additional information about how to format allowed_values + // of a boolean field for use by a single on/off checkbox widget. Since + // the widget might not have been selected yet, can be changed independently + // of this form, and can vary by form mode, we display this information + // regardless of current widget selection. + $element['allowed_values']['#description'] .= '

' . t("For a 'single on/off checkbox' widget, define the 'off' value first, then the 'on' value in the Allowed values section. Note that the checkbox will be labeled with the label of the 'on' value.") . '

'; } - // It is no longer possible to alter the description of allowed values - // depending on widget type because of form displays. The help text must - // instead be verbose. - $element['allowed_values']['#description'] .= '

' . t("For a 'single on/off checkbox' widget, define the 'off' value first, then the 'on' value in the Allowed values section. Note that the checkbox will be labeled with the label of the 'on' value.") . '

'; - $element['allowed_values']['#description'] .= '

' . t("The 'checkboxes/radio buttons' widget will display checkboxes if the Number of values option is greater than 1 for this field, otherwise radios will be displayed.") . '

'; $element['allowed_values']['#description'] .= '

' . t('Allowed HTML tags in labels: @tags', array('@tags' => _field_filter_xss_display_allowed_tags())) . '

'; $element['allowed_values_function'] = array(