Similar to #3209342: Links without "original_link" are filtered by admin_toolbar_links_access_filter I ran in to an exception due to non-existent "original_link":
The website encountered an unexpected error. Please try again later.
Error: Call to a member function getMenuName() on null in admin_toolbar_links_access_filter_preprocess_menu() (line 48 of modules/contrib/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.module).
In my case, I'm creating a faux menu and setting a custom #theme key so I can have a `menu--event.html.twig`. Then just adding #items to the render array...so it's basically all outside of the standard menu-building handlers. E.g.
$menu['#theme'] = 'menu__event';
foreach ($items as $index => &$item) {
...
$menu['#items'][] = [
'title' => $title,
'url' => $url,
];
}
Comments
Comment #2
natemow commentedPatch attached.
Comment #3
natemow commentedComment #4
dydave commentedNo activity on issue for more than 4 years.
Closing: outdated.
Thanks!