function ImageWidget::errorElement

File

core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php, line 351

Class

ImageWidget
Plugin implementation of the 'image_image' widget.

Namespace

Drupal\image\Plugin\Field\FieldWidget

Code

public function errorElement(array $element, ConstraintViolationInterface $error, array $form, FormStateInterface $form_state) {
    $element = parent::errorElement($element, $error, $form, $form_state);
    $property_path_array = explode('.', $error->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.