External links in menu trigger "no corresponding route" error

Created on 12 August 2024, 3 months ago

Problem/Motivation

We have an ultimenu block that uses a menu named "Main Navigation Menu." The menu contains four top-level links:

- The first link points to an external arcgis URL. This item is *not* enabled as an Ultimenu region.
- The other three links point to internal URLs. These *are* all enabled as Ultimenu regions.

If I disable the first link in the menu, the page works normally. But if enabled, I get the following error:

The website encountered an unexpected error. Try again later.

UnexpectedValueException: https://modnr.maps.arcgis.com/apps/webappviewer/index.html?id=0cc1b6513d... has no corresponding route. in Drupal\Core\Url->getRouteName() (line 567 of core/lib/Drupal/Core/Url.php).
Drupal\ultimenu\UltimenuManager->linkElement() (Line: 389)
Drupal\ultimenu\UltimenuManager->buildMenuItem() (Line: 306)
Drupal\ultimenu\UltimenuManager->buildMenuTree() (Line: 214)
Drupal\ultimenu\UltimenuManager->preRenderBuild()
call_user_func_array() (Line: 113)
Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 870)
Drupal\Core\Render\Renderer->doCallback() (Line: 432)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 475)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 83)
__TwigTemplate_b80bb93062c0b98a35465e03ec9e3da8->block_content() (Line: 430)
Twig\Template->yieldBlock() (Line: 69)
__TwigTemplate_b80bb93062c0b98a35465e03ec9e3da8->doDisplay() (Line: 360)
Twig\Template->yield() (Line: 335)
Twig\Template->render() (Line: 38)
Twig\TemplateWrapper->render() (Line: 33)
twig_render_template() (Line: 348)
Drupal\Core\Theme\ThemeManager->render() (Line: 491)
Drupal\Core\Render\Renderer->doRender() (Line: 504)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 475)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 46)
__TwigTemplate_3bb4475adc3276967c62c25cb18014f4->doDisplay() (Line: 360)
Twig\Template->yield() (Line: 335)
Twig\Template->render() (Line: 38)
Twig\TemplateWrapper->render() (Line: 33)
twig_render_template() (Line: 348)
Drupal\Core\Theme\ThemeManager->render() (Line: 491)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 475)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 87)
__TwigTemplate_b6126a844cdca1bac555f34efd32fe80->doDisplay() (Line: 360)
Twig\Template->yield() (Line: 335)
Twig\Template->render() (Line: 38)
Twig\TemplateWrapper->render() (Line: 33)
twig_render_template() (Line: 348)
Drupal\Core\Theme\ThemeManager->render() (Line: 491)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 158)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 153)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
call_user_func() (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 186)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 741)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Setting any link to point to any external URL seems to trigger the error.

Steps to reproduce

Set up a menu. Set all links to point to internal URLs. Configure Ultimenu to use this menu and enable all the menu items as regions. Place the ultimenu block on the page. It should work as expected.

Edit the menu and change any of the links to point to an external URL. Save and clear cache, and try to reload a page where the Ultimenu block should display. You should see an error similar to the above.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇺🇸United States wrd-oaitsd

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

Comments & Activities

Production build 0.71.5 2024