The menu_link_label data producer throws internal server error.

Created on 22 May 2025, about 2 months ago

Problem/Motivation

When using the menu_link_label data producer with a link, the user has no access to, ith throws an Internal server error.
The feason for that is, that MenuLinkLabel::resolve declares the return type to be string, but in case of an inaccessible link $link->getTitle() returns TranslatableMarkup.

Proposed resolution

Either cast the return value to string, or change the return type declaration to string|TranslatableMarkup.

🐛 Bug report
Status

Active

Version

5.0

Component

Code

Created by

🇩🇪Germany daniel.bosen

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