diff --git a/core/modules/book/src/BookManager.php b/core/modules/book/src/BookManager.php index 06dd84fdc..c4c0396b5 100644 --- a/core/modules/book/src/BookManager.php +++ b/core/modules/book/src/BookManager.php @@ -211,6 +211,10 @@ protected function findChildrenRelativeDepth(array $book_link) { * {@inheritdoc} */ public function addFormElements(array $form, FormStateInterface $form_state, NodeInterface $node, AccountInterface $account, $collapsed = TRUE) { + if (!$node->book) { + return $form; + } + // If the form is being processed during the Ajax callback of our book bid // dropdown, then $form_state will hold the value that was selected. if ($form_state->hasValue('book')) {