function _inline_form_errors_set_errors

Same name and namespace in other branches
  1. 10 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()
  3. 8.9.x 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()
InlineFormErrorsThemeHooks::preprocessDatetimeWrapper in core/modules/inline_form_errors/src/Hook/InlineFormErrorsThemeHooks.php
Implements hook_preprocess_HOOK() for datetime form wrapper templates.
InlineFormErrorsThemeHooks::preprocessDetails in core/modules/inline_form_errors/src/Hook/InlineFormErrorsThemeHooks.php
Implements hook_preprocess_HOOK() for details element templates.
InlineFormErrorsThemeHooks::preprocessFieldset in core/modules/inline_form_errors/src/Hook/InlineFormErrorsThemeHooks.php
Implements hook_preprocess_HOOK() for fieldset element templates.
InlineFormErrorsThemeHooks::preprocessFormElement in core/modules/inline_form_errors/src/Hook/InlineFormErrorsThemeHooks.php
Implements hook_preprocess_HOOK() for form element templates.

File

core/modules/inline_form_errors/inline_form_errors.module, line 10

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.