UnexpectedValueException: base:admin/content/advanced has no corresponding route

Created on 11 October 2023, about 1 year ago

Problem/Motivation

The following error is thrown.

UnexpectedValueException: base:admin/content/advanced has no corresponding route. in Drupal\Core\Url->getRouteName() (line 567 of core/lib/Drupal/Core/Url.php).
admin_toolbar_links_access_filter_filter_non_accessible_links(Array) (Line: 52)
admin_toolbar_links_access_filter_preprocess_menu(Array, 'menu__toolbar', Array)
call_user_func_array('admin_toolbar_links_access_filter_preprocess_menu', Array) (Line: 285)

Steps to reproduce

Create an admin menu with custom hard coded path like: admin/content/advanced

$original_link->getUrlObject()->getRouteName() is throwing an error.

Proposed resolution

Make additional check if getRouteName() can be called.

🐛 Bug report
Status

Active

Version

3.4

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024