function InlineFormErrorsThemeHooks::setErrors

Same name and namespace in other branches
  1. main core/modules/inline_form_errors/src/Hook/InlineFormErrorsThemeHooks.php \Drupal\inline_form_errors\Hook\InlineFormErrorsThemeHooks::setErrors()

Populates form errors in the template.

4 calls to InlineFormErrorsThemeHooks::setErrors()
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/src/Hook/InlineFormErrorsThemeHooks.php, line 50

Class

InlineFormErrorsThemeHooks
Hook implementations for inline_form_errors.

Namespace

Drupal\inline_form_errors\Hook

Code

protected function setErrors(&$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.