When rendering menu link items Ultimenu does not check if link is routed before attempting to get its routename

Created on 19 March 2025, 22 days ago

Problem/Motivation

We have been using ultimenu 2.x for our main navigation and in the process of upgrading to 3.x following this https://www.drupal.org/node/3447576 . After we upgraded we noticed WSOD on our site with the following error message
Uncaught PHP Exception UnexpectedValueException: "base:employee_services has no corresponding route." at /core/lib/Drupal/Core/Url.php line 567

After debugging we found that our main navigation menu has links that are relative such as '/employee_services', not a node reference, and is unrouted. Ultimenu, when rendering links, UltimenuManager only checks if a url is external and assumes that internal links are all routed. In our case we had internal links that are not routed.

Steps to reproduce

Create an ultimenu with relative links that are unrouted. In our case we had a redirect in place of /employee_services outside of drupal.

Proposed resolution

Ensure ultimenu checks an internal url is routed first before attempting to get its routename.

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇺🇸United States hablat

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