Problem/Motivation

When a custom menu has external links (https://www...) the site breaks because the link has no route.

Steps to reproduce

Create a link in a menu to https://www.google.com

Proposed resolution

Check to see if the link is routed before checking the routename

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

  • 1.0.x Comparecompare

Comments

willeaton created an issue. See original summary.

willeaton’s picture

All we have to do is change:

if ($element->link->getUrlObject()->getRouteName() === '<front>') {
  $system_path = '<front>';
}

to

if ($element->link->getUrlObject()->isRouted() && $element->link->getUrlObject()->getRouteName() === '<front>') {
  $system_path = '<front>';
}
willeaton’s picture

Created issue fork and uploaded changes.

willeaton’s picture

Status: Active » Needs review
jmauricio’s picture

Assigned: Unassigned » jmauricio

  • jmauricio committed cf156357 on 1.0.x
    Issue #3394415 by willeaton, jmauricio: Error external links
jmauricio’s picture

Assigned: jmauricio » Unassigned
Status: Needs review » Reviewed & tested by the community

Commited to 1.0x

jmauricio’s picture

Status: Reviewed & tested by the community » Fixed
jmauricio’s picture