From d4ac8181c8c7d549a1e1629219f40127ffc297d0 Mon Sep 17 00:00:00 2001
From: webchick <drupal@webchick.net>
Date: Thu, 12 Jun 2014 19:49:19 -0700
Subject: [PATCH] Issue #2250325 by jhodgdon, azinck, splatio: Fixed Route
 book.render (path /book) does not seem to work.

---
 .../book/src/Controller/BookController.php        |  2 +-
 core/modules/book/src/Tests/BookTest.php          | 15 +++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/core/modules/book/src/Controller/BookController.php b/core/modules/book/src/Controller/BookController.php
index dec592c5ff0b..305a0b9ffbe8 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 cfd755917ef4..6d8b321cac51 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.');
+  }
 }
-- 
GitLab