public function BookSettingsForm::validateForm

Implements \Drupal\Core\Form\FormInterface::validateForm().

Overrides SystemConfigFormBase::validateForm

File

drupal/core/modules/book/lib/Drupal/book/BookSettingsForm.php, line 53
Contains \Drupal\book\BookSettingsForm.

Class

BookSettingsForm
Configure book settings for this site.

Namespace

Drupal\book

Code

public function validateForm(array &$form, array &$form_state) {
  $child_type = $form_state['values']['book_child_type'];
  if (empty($form_state['values']['book_allowed_types'][$child_type])) {
    form_set_error('book_child_type', t('The content type for the %add-child link must be one of those selected as an allowed book outline type.', array(
      '%add-child' => t('Add child page'),
    )));
  }
  parent::validateForm($form, $form_state);
}