function TextareaWithSummaryWidget::errorElement

Same name in other branches
  1. 8.9.x core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php \Drupal\text\Plugin\Field\FieldWidget\TextareaWithSummaryWidget::errorElement()
  2. 10 core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php \Drupal\text\Plugin\Field\FieldWidget\TextareaWithSummaryWidget::errorElement()
  3. 11.x core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php \Drupal\text\Plugin\Field\FieldWidget\TextareaWithSummaryWidget::errorElement()

Overrides TextareaWidget::errorElement

File

core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php, line 102

Class

TextareaWithSummaryWidget
Plugin implementation of the 'text_textarea_with_summary' widget.

Namespace

Drupal\text\Plugin\Field\FieldWidget

Code

public function errorElement(array $element, ConstraintViolationInterface $violation, array $form, FormStateInterface $form_state) {
    $element = parent::errorElement($element, $violation, $form, $form_state);
    $property_path_array = explode('.', $violation->getPropertyPath());
    return $element === FALSE ? FALSE : $element[$property_path_array[1]];
}

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