You are here

public function ReadonlyFieldWidget::flagErrors in Read-only Field Widget 8

Reports field-level validation errors against actual form elements.

Parameters

\Drupal\Core\Field\FieldItemListInterface $items: The field values.

\Symfony\Component\Validator\ConstraintViolationListInterface $violations: A list of constraint violations to flag.

array $form: The form structure where field elements are attached to. This might be a full form structure, or a sub-element of a larger form.

\Drupal\Core\Form\FormStateInterface $form_state: The form state.

Overrides WidgetBase::flagErrors

File

src/Plugin/Field/FieldWidget/ReadonlyFieldWidget.php, line 266

Class

ReadonlyFieldWidget
Plugin implementation of the 'readonly_field_widget' widget.

Namespace

Drupal\readonly_field_widget\Plugin\Field\FieldWidget

Code

public function flagErrors(FieldItemListInterface $items, ConstraintViolationListInterface $violations, array $form, FormStateInterface $form_state) {

  // Skip validation for read only fields.
}