Steps to reproduce:

1. Add menu link with a path that comes from a custom module route or a view page
2. Got that path

UnexpectedValueException: External URLs do not have an internal route name. in Drupal\Core\Url->getRouteName() (line 554 of core/lib/Drupal/Core/Url.php).

Drupal\menu_breadcrumb\MenuBasedBreadcrumbBuilder->build(Object) (Line: 83)
Drupal\Core\Breadcrumb\BreadcrumbManager->build(Object) (Line: 72)
Drupal\system\Plugin\Block\SystemBreadcrumbBlock->build() (Line: 203)
Drupal\block\BlockViewBuilder::preRender(Array)
call_user_func('Drupal\block\BlockViewBuilder::preRender', Array) (Line: 406)

Comments

zerolab created an issue. See original summary.

znak’s picture

Assigned: Unassigned » znak
znak’s picture

Assigned: znak » Unassigned
Status: Active » Needs review
StatusFileSize
new1015 bytes

Please, check up the patch.

zerolab’s picture

Status: Needs review » Needs work

That fixes the problem.

May I point that the patch exceeds the coding style line length by quite a lot? So "Needs work" from that point of view.

Thanks.

rphair’s picture

Assigned: Unassigned » rphair

I'll fix any coding standard issues when checking it in (as soon as I get a break in work schedule), thanks for the patch...

therobyouknow’s picture

Great - patch in comment #3 works fine for my scenario too - thank you very much Znak!

The patch applied fine to 8.x-1.3

This patch enabled my scenario to work: I created a blog content and had this as a submenu option beneath another menu option.

Before this patch I got the same error as the original poster.

Only for information I've included the full stack dump I saw to help others find this issue when searching.

The website encountered an unexpected error. Please try again later.

UnexpectedValueException: External URLs do not have an internal route name. in Drupal\Core\Url->getRouteName() (line 555 of core/lib/Drupal/Core/Url.php).
Drupal\menu_breadcrumb\MenuBasedBreadcrumbBuilder->build(Object) (Line: 83)
Drupal\Core\Breadcrumb\BreadcrumbManager->build(Object) (Line: 72)
Drupal\system\Plugin\Block\SystemBreadcrumbBlock->build() (Line: 203)
Drupal\block\BlockViewBuilder::preRender(Array)
call_user_func('Drupal\block\BlockViewBuilder::preRender', Array) (Line: 376)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 448)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 490)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 77)
__TwigTemplate_9f3a5d86bd6c6fd210cecd547dcee19d115c6dd07afe8ec40c3c1084c56e3276->doDisplay(Array, Array) (Line: 432)
Twig_Template->displayWithErrorHandling(Array, Array) (Line: 403)
Twig_Template->display(Array) (Line: 47)
__TwigTemplate_71c06bfd1e10f4ee4d13a9e181f20c211136942204731dd7ba37151ef20c9b88->doDisplay(Array, Array) (Line: 432)
Twig_Template->displayWithErrorHandling(Array, Array) (Line: 403)
Twig_Template->display(Array) (Line: 411)
Twig_Template->render(Array) (Line: 64)
twig_render_template('themes/base/templates/layout/page.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('page', Array) (Line: 435)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 490)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 8126)
__TwigTemplate_6c3abf2af76991b626704a35403c48662fea7276ba62877380e3dbbcb62d6529->doDisplay(Array, Array) (Line: 432)
Twig_Template->displayWithErrorHandling(Array, Array) (Line: 403)
Twig_Template->display(Array) (Line: 411)
Twig_Template->render(Array) (Line: 64)
twig_render_template('themes/base/templates/layout/html.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('html', Array) (Line: 435)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 147)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 148)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 149)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 656)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

  • rphair committed 206ec38 on 8.x-1.x authored by Znak
    Issue #2896930 by Znak, rphair: External URLs do not have an internal...
rphair’s picture

Status: Needs work » Fixed

dear @zerolab - Line length is fine the way it is since there's a superseding rule about not breaking up multi-line conditionals. However I find it quite difficult to keep a grip on the logic without breaking up the clauses (which also limits the line length), and it passes the linter with the line broken up, so I'm checking it in that way.

Thanks to all for contributing & testing the patch: it's just in dev now & I'll push it out as 1.4 once one or two of the subscribers here can confirm that dev works after the check-in.

rphair’s picture

no response from peanut gallery but no problems reported from dev community either. Releasing current dev version as 8.x-1.4 so more people can start testing on drupal 8.4.0-alpha1.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.