diff --git a/core/modules/book/src/Controller/BookController.php b/core/modules/book/src/Controller/BookController.php index dec592c5ff0b7a6e0549f951e6f4b1a1d58453c5..305a0b9ffbe8bd42df07ce95a4141ad9d9d33445 100644 --- a/core/modules/book/src/Controller/BookController.php +++ b/core/modules/book/src/Controller/BookController.php @@ -105,7 +105,7 @@ public function adminOverview() { public function bookRender() { $book_list = array(); foreach ($this->bookManager->getAllBooks() as $book) { - $book_list[] = l($book['title'], $book['href'], $book['options']); + $book_list[] = l($book['title'], $book['link_path']); } return array( '#theme' => 'item_list', diff --git a/core/modules/book/src/Tests/BookTest.php b/core/modules/book/src/Tests/BookTest.php index cfd755917ef4c6c2a5059469398ec7e33abdb27d..6d8b321cac5173198e5568f4717559399a7173da 100644 --- a/core/modules/book/src/Tests/BookTest.php +++ b/core/modules/book/src/Tests/BookTest.php @@ -605,4 +605,19 @@ public function testSaveBookLink() { $this->assertEqual($return, $link); } + /** + * Tests the listing of all books. + */ + public function testBookListing() { + // Create a new book. + $this->createBook(); + + // Must be a user with 'node test view' permission since node_access_test is enabled. + $this->drupalLogin($this->web_user); + + // Load the book page and assert the created book title is displayed. + $this->drupalGet('book'); + + $this->assertText($this->book->label(), 'The book title is displayed on the book listing page.'); + } }