"is_expanded" is set to true even if "below" is an empty array

Created on 3 January 2024, 12 months ago
Updated 2 February 2024, 11 months ago

Problem/Motivation

MenuLinkTree::buildItems sets is_expanded if there are children and subtree data. But later on $element['below'] = $this->buildItems() can lead to all the "below" link items to be filtered out. This leads to cases where menu items are all filtered and twig thinking it should display an "expanded" indicator when no items are "below".

The comment in menu.html.twig file says:

is_expanded: TRUE if the link has visible children within the current menu tree.
below: The menu item child items.

This indicates to me that we are dealing with 2 different things. honestly the is_expanded shouldn't really be needed but is probably cruft from D6 or D7 days.

Steps to reproduce

The tests actually are in error already and they needed a fix to cover the exact bug being seen here.

Proposed resolution

TBD

Remaining tasks

Update issue summary

User interface changes

NA

API changes

NA

Data model changes

NA

Release notes snippet

NA

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Menu system 

Last updated about 22 hours ago

Created by

heddn Nicaragua

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