function TextareaWithSummaryWidget::errorElement
Overrides TextareaWidget::errorElement
File
-
core/
modules/ text/ src/ Plugin/ Field/ FieldWidget/ TextareaWithSummaryWidget.php, line 101
Class
- TextareaWithSummaryWidget
- Plugin implementation of the 'text_textarea_with_summary' widget.
Namespace
Drupal\text\Plugin\Field\FieldWidgetCode
public function errorElement(array $element, ConstraintViolationInterface $violation, array $form, FormStateInterface $form_state) {
$element = parent::errorElement($element, $violation, $form, $form_state);
if ($element === FALSE) {
return FALSE;
}
$property_path_array = explode('.', $violation->getPropertyPath());
return count($property_path_array) > 1 ? $element[$property_path_array[1]] : $element;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.