diff -u b/core/modules/book/book.module b/core/modules/book/book.module --- b/core/modules/book/book.module +++ b/core/modules/book/book.module @@ -62,9 +62,9 @@ 'book_navigation' => array( 'variables' => array('book_link' => NULL), ), - 'book_tree' => [ - 'variables' => ['items' => [], 'attributes' => []], - ], + 'book_tree' => array( + 'variables' => array('items' => array(), 'attributes' => array()), + ), 'book_export_html' => array( 'variables' => array('title' => NULL, 'contents' => NULL, 'depth' => NULL), ), diff -u b/core/modules/book/src/BookManager.php b/core/modules/book/src/BookManager.php --- b/core/modules/book/src/BookManager.php +++ b/core/modules/book/src/BookManager.php @@ -501,7 +501,7 @@ /** * {@inheritdoc} */ - public function build(array $tree) { + public function bookTreeOutput(array $tree) { $items = $this->buildItems($tree); $build = []; @@ -525,7 +525,7 @@ /** * Builds the #items property for a book tree's renderable array. * - * Helper function for ::build(). + * Helper function for ::bookTreeOutput(). * * @param array $tree * A data structure representing the tree. diff -u b/core/modules/book/src/BookManagerInterface.php b/core/modules/book/src/BookManagerInterface.php --- b/core/modules/book/src/BookManagerInterface.php +++ b/core/modules/book/src/BookManagerInterface.php @@ -257,7 +257,7 @@ * * @see \Drupal\Core\Menu\MenuLinkTree::build */ - public function build(array $tree); + public function bookTreeOutput(array $tree); /** * Checks access and performs dynamic operations for each link in the tree. reverted: --- b/core/modules/book/src/BookOutline.php +++ a/core/modules/book/src/BookOutline.php @@ -126,7 +126,7 @@ } if ($children) { + $elements = $this->bookManager->bookTreeOutput($children); - $elements = $this->bookManager->build($children); return drupal_render($elements); } return ''; reverted: --- b/core/modules/book/src/Plugin/Block/BookNavigationBlock.php +++ a/core/modules/book/src/Plugin/Block/BookNavigationBlock.php @@ -137,7 +137,7 @@ // If the current page is a node associated with a book, the menu // needs to be retrieved. $data = $this->bookManager->bookTreeAllData($node->book['bid'], $node->book); + $book_menus[$book_id] = $this->bookManager->bookTreeOutput($data); - $book_menus[$book_id] = $this->bookManager->build($data); } else { // Since we know we will only display a link to the top node, there @@ -147,7 +147,7 @@ $book_node = $this->nodeStorage->load($book['nid']); $book['access'] = $book_node->access('view'); $pseudo_tree[0]['link'] = $book; + $book_menus[$book_id] = $this->bookManager->bookTreeOutput($pseudo_tree); - $book_menus[$book_id] = $this->bookManager->build($pseudo_tree); } $book_menus[$book_id] += array( '#book_title' => $book['title'], @@ -169,7 +169,7 @@ $tree = $this->bookManager->bookTreeAllData($node->book['bid'], $node->book); // There should only be one element at the top level. $data = array_shift($tree); + $below = $this->bookManager->bookTreeOutput($data['below']); - $below = $this->bookManager->build($data['below']); if (!empty($below)) { return $below; }