1 text.module text_field_instance_settings_form_validate($element, &$form_state, $complete_form)

Element validate handler for text_field_instance_settings_form().

File

core/modules/field/modules/text/text.module, line 147
Defines simple text field types.

Code

function text_field_instance_settings_form_validate($element, &$form_state, $complete_form) {
  $all_formats = array_keys($element['allowed_formats']['#options']);
  $enabled_formats = array_keys(array_filter($element['allowed_formats']['#value']));
  $enabled_formats[] = filter_fallback_format();
  // If all formats are enabled, save as an empty array, which implies no
  // restrictions on this field's formats.
  if ($all_formats == $enabled_formats) {
    $enabled_formats = array();
  }
  form_set_value($element['allowed_formats'], $enabled_formats, $form_state);
}