You are here

public static function ReferenceWidget::validateReferenceWidget in Select (or other) 4.x

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldWidget/ReferenceWidget.php \Drupal\select_or_other\Plugin\Field\FieldWidget\ReferenceWidget::validateReferenceWidget()

Form element validation handler for select_or_other_reference elements.

@codeCoverageIgnore Ignore

File

src/Plugin/Field/FieldWidget/ReferenceWidget.php, line 238

Class

ReferenceWidget
Plugin implementation of the 'select_or_other_reference' widget.

Namespace

Drupal\select_or_other\Plugin\Field\FieldWidget

Code

public static function validateReferenceWidget(array &$element, FormStateInterface $form_state, array &$complete_form) {
  self::prepareElementValuesForValidation($element);
  if (!empty($element['#value'])) {
    EntityAutocomplete::validateEntityAutocomplete($element, $form_state, $complete_form);
  }
}