function FileWidget::flagErrors
Overrides WidgetBase::flagErrors
File
-
core/
modules/ file/ src/ Plugin/ Field/ FieldWidget/ FileWidget.php, line 601
Class
- FileWidget
- Plugin implementation of the 'file_generic' widget.
Namespace
Drupal\file\Plugin\Field\FieldWidgetCode
public function flagErrors(FieldItemListInterface $items, ConstraintViolationListInterface $violations, array $form, FormStateInterface $form_state) {
// Never flag validation errors for the remove button.
$clicked_button = end($form_state->getTriggeringElement()['#parents']);
if ($clicked_button !== 'remove_button') {
parent::flagErrors($items, $violations, $form, $form_state);
}
}