You are here

public function ContentEntityConfirmFormBase::validateForm in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php \Drupal\Core\Entity\ContentEntityConfirmFormBase::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

core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php, line 116

Class

ContentEntityConfirmFormBase
Provides a generic base class for an entity-based confirmation form.

Namespace

Drupal\Core\Entity

Code

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

  // Override the default validation implementation as it is not necessary
  // nor possible to validate an entity in a confirmation form.
  return $this->entity;
}