You are here

public function ContributorForm::validateForm in Bibliography & Citation 8

Same name and namespace in other branches
  1. 2.0.x modules/bibcite_entity/src/Form/ContributorForm.php \Drupal\bibcite_entity\Form\ContributorForm::validateForm()

Button-level validation handlers are highly discouraged for entity forms, as they will prevent entity validation from running. If the entity is going to be saved during the form submission, this method should be manually invoked from the button-level validation handler, otherwise an exception will be thrown.

Overrides ContentEntityForm::validateForm

File

modules/bibcite_entity/src/Form/ContributorForm.php, line 29

Class

ContributorForm
Form controller for Contributor edit forms.

Namespace

Drupal\bibcite_entity\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {

  // Unset submitted "name" field value so it's not set on entity and
  // other name parts are not overwritten by parsed values when entity is
  // saved.
  $form_state
    ->unsetValue('name');
  parent::validateForm($form, $form_state);
}