Editing menu results in 500 error

Created on 25 February 2025, about 2 months ago

Problem/Motivation

Clicking edit icon on menu item in a page's (contrib) tb_megamenu menu block results in progress arrow continuously and browser console show AJAX call had returned HTTP 500. Expanding this shows exception text: 'Object of type ...Entity\Menu cannot be printed.'

Steps to reproduce

Clicking edit icon on menu item in a page's menu block.

Proposed resolution

The Exception is thrown in core/lib/Drupal/Core/Template/TwigExtension.php. This filter looks for a toString() etc method on the menu entity (in core/modules/system/src/Entity/Menu.php)
Resolve by adding a simple toString() method to Menu entity, returning the label or id property.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

šŸ› Bug report
Status

Active

Version

10.5 āœØ

Component

menu.module

Created by

šŸ‡¬šŸ‡§United Kingdom Jons

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