Fatal error when using menus in hook_collections

Created on 18 December 2024, about 10 hours ago

Problem/Motivation

When trying to group menus using the hook_admin_toolbar_content_collections() a fatal error is thrown:
Symfony\Component\Routing\Exception\MissingMandatoryParametersException: Some mandatory parameters are missing ("menu") to generate a URL for route "entity.menu.edit_form".

Steps to reproduce

Use 2.1.0 version of this module.
Create a custom module implementing the hook_admin_toolbar_content_collections()
Uses the 'menus' functionality to group menus
Clear cache
Load any page as logged in user which have access to the toolbar
The error will be thrown

Proposed resolution

A bug in AdminToolbarContentMenusPlugin results in this error because here the edit form is used instead of the collection link. Resulting in the missing required parameter.

Remaining tasks

Patch
New release

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇧🇪Belgium kevinvb

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