Undefined index in template_preprocess_book_navigation() when parent node access is denied

Created on 17 February 2016, almost 9 years ago
Updated 4 September 2024, 4 months ago

Problem/Motivation

Bug occurs when access is denied for the current user to a node in a book hierarchy

When visiting a child page there is an undefined index for title on line 425 of book.module

The undefined index is in function template_preprocess_book_navigation()

In Drupal 7 the return value of _menu_link_translate() is FALSE if access is denied

In Drupal 8 \Drupal\book\BookManagerInterface::loadBookLink always returns an array, so it's never empty unless the node doesn't exist.

In Drupal 8 we need to check the value of the access key in the array.

Proposed resolution

Fix logic of line 418 in book.module.

Add a test (?)

Remaining tasks

patch & review

User interface changes

n/a

API changes

n/a

Data model changes

n/a

πŸ› Bug report
Status

Needs work

Version

2.0

Component
BookΒ  β†’

Last updated 6 days ago

  • Maintained by
  • πŸ‡ΊπŸ‡ΈUnited States @pwolanin
Created by

πŸ‡ΊπŸ‡ΈUnited States pwolanin

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024