How to reproduce: go to /book.

Full error:

Catchable fatal error: Argument 3 passed to l() must be of the type array, null given, called in /var/www/drupal-8/core/modules/book/src/Controller/BookController.php on line 108 and defined in /var/www/drupal-8/core/includes/common.inc on line 830
Call Stack
#	Time	Memory	Function	Location
1	0.0003	235144	{main}( )	../index.php:0
2	0.0010	383800	drupal_handle_request( )	../index.php:17
3	0.0124	1578128	Drupal\Core\DrupalKernel->handle( )	../bootstrap.inc:1388
4	0.0143	1767824	Drupal\Core\HttpKernel->handle( )	../DrupalKernel.php:306
5	0.0144	1769432	Symfony\Component\HttpKernel\HttpKernel->handle( )	../HttpKernel.php:44
6	0.0144	1769928	Symfony\Component\HttpKernel\HttpKernel->handleRaw( )	../HttpKernel.php:66
7	0.0320	3885072	call_user_func_array ( )	../HttpKernel.php:126
8	0.0320	3885544	Drupal\Core\Controller\HtmlPageController->content( )	../HttpKernel.php:126
9	0.0320	3885640	Drupal\Core\Controller\HtmlPageController->getContentResult( )	../HtmlPageController.php:53
10	0.0368	4459688	call_user_func_array ( )	../HtmlPageController.php:76
11	0.0368	4459912	Drupal\book\Controller\BookController->bookRender( )	../HtmlPageController.php:76
12	0.0483	6261000	l( )	../BookController.php:108

Comments

pushpinderchauhan’s picture

Assigned: Unassigned » pushpinderchauhan
pushpinderchauhan’s picture

Status: Active » Needs review
StatusFileSize
new674 bytes

Added patch after testing.

primsi’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

primsi’s picture

Now that I think of it. If we had tests for this, it would be even better :)

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

Now that I think of it. If we had tests for this, it would be even better :)

Yep - we need tests to cover this a prove the issue.

pushpinderchauhan’s picture

Assigned: pushpinderchauhan » Unassigned

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

lomo’s picture

Status: Needs work » Closed (cannot reproduce)
Issue tags: +Needs reroll
error: patch failed: core/modules/book/src/Controller/BookController.php:105
error: core/modules/book/src/Controller/BookController.php: patch does not apply

I just enabled the book module, created some dummy book pages, put them into a hierarchy and went to /book and got no fatal error. (I also tried, before creating any book pages, and still had no errors). I think this issue is no longer, at least not in the 8.4.x branch.

And if it IS still an issue, then we need to re-roll the patch... I was prepared to sort that out, but it doesn't look like that is necessary...

savkaviktor16@gmail.com’s picture

Status: Closed (cannot reproduce) » Needs review
Issue tags: -Needs reroll
StatusFileSize
new661 bytes

re-rolled

dani3lr0se’s picture

Status: Needs review » Reviewed & tested by the community

Tested with simplytest.me on 8.3.x and can confirm that the patch works. When I navigate to "/books" it shows my books. This could probably be used on 8.5.x as well? I'll try making the patch for 8.5.x., but if someone beats me to it, it's no biggie. Thanks for the help and thanks for this patch. :)

xjm’s picture

Version: 8.3.x-dev » 8.5.x-dev
Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

Thanks for working on this issue.

What actually needs to happen on this issue is what's described in #10. Rerolling a patch and testing it isn't helpful if there's evidence that the fix is obsolete.

The STR aren't sufficient to produce this error for me. I tried:

  1. Installing 8.5.x HEAD with the standard profile.
  2. Creating a book page and making it the top-level page of a book.
  3. Visiting /book.

So it looks like we need more specific steps to reproduce this problem. There's no need to roll a patch if the issue is not reproducible. And if it still is reproducible, but only under certain circumsrtances, we need to know why. The bug could be in the calling code.

It also needs to have test coverage, as per #5. The test coverage would prove that the bug exists.

Or, if the bug simply does not exist, it can be marked back to "Cannot reproduce".

dani3lr0se’s picture

Thanks for the feedback @xjm. That makes sense. I should've thought about that before reviewing.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

ptmkenny’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Closing this because reading over the issue suggests that the issue was fixed by 8.4.x, and there was no follow-up after #14.