You are here

function _inline_form_errors_set_errors in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/inline_form_errors/inline_form_errors.module \_inline_form_errors_set_errors()
  2. 9 core/modules/inline_form_errors/inline_form_errors.module \_inline_form_errors_set_errors()

Populates form errors in the template.

4 calls to _inline_form_errors_set_errors()
inline_form_errors_preprocess_datetime_wrapper in core/modules/inline_form_errors/inline_form_errors.module
Implements hook_preprocess_HOOK() for datetime form wrapper templates.
inline_form_errors_preprocess_details in core/modules/inline_form_errors/inline_form_errors.module
Implements hook_preprocess_HOOK() for details element templates.
inline_form_errors_preprocess_fieldset in core/modules/inline_form_errors/inline_form_errors.module
Implements hook_preprocess_HOOK() for fieldset element templates.
inline_form_errors_preprocess_form_element in core/modules/inline_form_errors/inline_form_errors.module
Implements hook_preprocess_HOOK() for form element templates.

File

core/modules/inline_form_errors/inline_form_errors.module, line 68
Enables inline form errors.

Code

function _inline_form_errors_set_errors(&$variables) {
  $element = $variables['element'];
  if (!empty($element['#errors']) && empty($element['#error_no_message'])) {
    $variables['errors'] = $element['#errors'];
  }
}