I get the following error if I add a external link to the main navigation. i.e. https://www.example.com

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

The error log shows the following error.

Type: php
Location: /node
Referrer: /admin/structure/menu/manage/main
Message: UnexpectedValueException: External URLs do not have an internal route name. in Drupal\Core\Url->getRouteName() (line 555 of /core/lib/Drupal/Core/Url.php).
Severity: Error

Notes:

- Drupal 8.4: External menu links work with Bartik and Bootstrap themes, broken in AT.
- Drupal 8.2.8 External menu links work fine with AT

Site Info

Drupal: 8.4.0
Web Server: Apache/2.4.17 (Unix) OpenSSL/1.0.1h mod_fcgid/2.3.9
PHP Version: 7.0.14
Memory limit: 256M
Database Version: MySQL

Comments

Bwolf created an issue. See original summary.

jwkovell’s picture

To further narrow down the issue a little more, I can confirm that Adaptive Theme on Drupal 8.3.7 does work when using external links in the menu.

The problem must be newer than that (or some other factor we haven't considered).

Bwolf’s picture

Just created a clean install of Drupal 8.4. with adaptive theme and AT Tools only still broken.

Modules: AT Tools 8.x-2.0+6-dev (2017-Sep-02)
Themes: Adaptive Theme: 8.x-2.0+16-dev (2017-Sep-02)

Drupal: 8.4.0
Web Server: Apache/2.4.17 (Unix) OpenSSL/1.0.1h mod_fcgid/2.3.9
PHP Version: 7.0.14
Memory limit: 256M
Database Version: MySQL

Jeff Burnz’s picture

Assigned: Unassigned » Jeff Burnz

Assigning to myself. Cheers!

  • Jeff Burnz committed eefdc44 on 8.x-3.x
    Issue #2916860: Site Error When Adding External Links to Main Navigation...

  • Jeff Burnz committed eefdc44 on 8.x-2.x
    Issue #2916860: Site Error When Adding External Links to Main Navigation...
Jeff Burnz’s picture

OK, this came from an addition to support the <nolink> route_name feature.

I've had to update the menu.html.twig template so if you have that in your theme you'll need to update it.

Jeff Burnz’s picture

Status: Active » Fixed

Should be fixed.

Status: Fixed » Closed (fixed)

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

Hitby’s picture

Hi,
Could you please advise how to fix this?
I've created a new menu with four external links in. Adding the menu block to my site gives me

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

with the following php error in the log

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

I'm running a sub theme with Base: at_core (8.x-2.0+16-dev) and At Tools 8.x-2.0+8-dev

Thanks,

Hitby’s picture

Ignore me,
I updated the theme but needed to copy menu.html.twig to my sub theme as well.