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;
}
doc_Drupal
2016-10-29 08:57:08
Comments
Leave a Comment

Please login to continue.