Parent menu items that require authentication to see cause the menu to break

Created on 17 January 2025, 3 months ago

Problem/Motivation

The page breaks when an anonymous user views a page that is added to a menu and the parent menu item requires a user to be authenticated to see it.

The logs return:

TypeError: array_walk(): Argument #1 ($array) must be of type array, null given in array_walk() (line 162 of /code/web/modules/composer/contextual_menu_block/src/Plugin/Block/ContextualMenuBlock.php).

Steps to reproduce

Add a public page to a menu where the parent menu item requires authentication to see it.

Proposed resolution

Check to see if the menu item has any '#items' in the menu before building the menu block.

🐛 Bug report
Status

Active

Version

1.3

Component

Code

Created by

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024