W3cubDocs

/Drupal 8

public function ContentEntityConfirmFormBase::validateForm

public ContentEntityConfirmFormBase::validateForm(array &$form, FormStateInterface $form_state)

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;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!ContentEntityConfirmFormBase.php/function/ContentEntityConfirmFormBase::validateForm/8.1.x