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)
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | external_URLs_do_not_have_an_internal_route_name-2896930-3.patch | 1015 bytes | znak |
Comments
Comment #2
znak commentedComment #3
znak commentedPlease, check up the patch.
Comment #4
zerolab commentedThat 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.
Comment #5
rphair commentedI'll fix any coding standard issues when checking it in (as soon as I get a break in work schedule), thanks for the patch...
Comment #6
therobyouknow commentedGreat - 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.
Comment #8
rphair commenteddear @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.
Comment #9
rphair commentedno 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.