From a75e52abee6a04b73f8267b7b27dd6ba97b704e1 Mon Sep 17 00:00:00 2001 From: Alex Pott <alex.a.pott@googlemail.com> Date: Thu, 2 Oct 2014 12:09:11 +0200 Subject: [PATCH] Issue #2348413 by Cottser, tim.plunkett: Fixed Fatal error at /admin/structure/book. --- .../modules/book/src/Controller/BookController.php | 2 +- core/modules/book/src/Tests/BookTest.php | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/core/modules/book/src/Controller/BookController.php b/core/modules/book/src/Controller/BookController.php index 9e7a11f4acc8..3079032223c3 100644 --- a/core/modules/book/src/Controller/BookController.php +++ b/core/modules/book/src/Controller/BookController.php @@ -73,7 +73,7 @@ public function adminOverview() { // Add any recognized books to the table list. foreach ($this->bookManager->getAllBooks() as $book) { /** @var \Drupal\Core\Url $url */ - $url = $book->urlInfo(); + $url = $book['url']; if (isset($book['options'])) { $url->setOptions($book['options']); } diff --git a/core/modules/book/src/Tests/BookTest.php b/core/modules/book/src/Tests/BookTest.php index d4cf57f5addd..591ac380457e 100644 --- a/core/modules/book/src/Tests/BookTest.php +++ b/core/modules/book/src/Tests/BookTest.php @@ -623,4 +623,18 @@ public function testBookListing() { $this->assertText($this->book->label(), 'The book title is displayed on the book listing page.'); } + + /** + * Tests the administrative listing of all books. + */ + public function testAdminBookListing() { + // Create a new book. + $this->createBook(); + + // Load the book page and assert the created book title is displayed. + $this->drupalLogin($this->admin_user); + $this->drupalGet('admin/structure/book'); + $this->assertText($this->book->label(), 'The book title is displayed on the administrative book listing page.'); + } + } -- GitLab