function BookAdminEditForm::validateForm
Same name in other branches
- 8.9.x core/modules/book/src/Form/BookAdminEditForm.php \Drupal\book\Form\BookAdminEditForm::validateForm()
- 10 core/modules/book/src/Form/BookAdminEditForm.php \Drupal\book\Form\BookAdminEditForm::validateForm()
- 11.x core/modules/book/src/Form/BookAdminEditForm.php \Drupal\book\Form\BookAdminEditForm::validateForm()
Overrides FormBase::validateForm
File
-
core/
modules/ book/ src/ Form/ BookAdminEditForm.php, line 102
Class
- BookAdminEditForm
- Provides a form for administering a single book's hierarchy.
Namespace
Drupal\book\FormCode
public function validateForm(array &$form, FormStateInterface $form_state) {
if ($form_state->getValue('tree_hash') != $form_state->getValue('tree_current_hash')) {
$form_state->setErrorByName('', $this->t('This book has been modified by another user, the changes could not be saved.'));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.