Problem/Motivation

Steps to reproduce:

  • Install D8 with the Standard profile
  • Enable Book module
  • Navigate to /admin/structure/book
  • Create a new book page (/node/add/book), setting the value in Book outline > Book to '- Create a new book -'

See this fatal error:

Fatal error: Call to a member function urlInfo() on a non-object in /Users/sreeves/Sites/d8.dev/core/modules/book/src/Controller/BookController.php on line 76

Proposed resolution

Fix it.

Remaining tasks

  • Write patch to fix the bug
  • Write test coverage

User interface changes

n/a

API changes

TBD, not likely

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tim.plunkett’s picture

Status: Active » Needs review
Issue tags: +Needs tests
FileSize
622 bytes

BookManager::loadBooks puts the urlInfo in ['url'].

We need test coverage here.

star-szr’s picture

Assigned: Unassigned » star-szr

Thanks! I can put together a web test.

star-szr’s picture

Assigned: star-szr » Unassigned
Issue tags: -Needs tests
FileSize
850 bytes
1.44 KB

This should do the trick.

The last submitted patch, 3: 2348413-3-testonly.patch, failed testing.

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Great! Thanks @Cottser

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Can we get a followup to improve the documentation of getAllBooks to describe what is in the array it returns.

Committed a75e52a and pushed to 8.0.x. Thanks!

  • alexpott committed a75e52a on 8.0.x
    Issue #2348413 by Cottser, tim.plunkett: Fixed Fatal error at /admin/...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.