Hi everyone.

I've currently encountered an issue with the menu_breadcrumb module.

Everytime I reach a page, (well not necesserally on all pages, duno why ...) I end up with a critical error :

Uncaught PHP Exception UnexpectedValueException: "External URLs do not have an internal route name." at D:\Inetpub\vhosts\mexmafood.eu\httpdocs\core\lib\Drupal\Core\Url.php line 554

After checking Url.php, line 554, I see that the $url_object is being checked on its route name. Apparently the condition :

if ($url_object->getRouteName() != "<front>") {
    $links[] = Link::fromTextAndUrl($text, $url_object);
}

is not working, if I remove the condition but keep the line inside it, it's working.. Any idea? Is it me or the module? :x

Comments

TheKhatsLover created an issue. See original summary.

TheDucksLover’s picture

Assigned: TheDucksLover » Unassigned
TheDucksLover’s picture

It apparently appears when one tries to reach an element whose parent is an external link.

rphair’s picture

This is a duplicate of https://www.drupal.org/node/2750821 - also related to the problem https://www.drupal.org/node/2754521 - both patched. Both issues relate to the same impossible if statement.

The patches submitted for the problems with this module haven't been reviewed in about 2 months at this time. Nothing has been accepted by the module maintainers to fix the problems with the code originally provided for Drupal 8. There is a spurious code objection in 2754521-5 that I hope others will help settle, since that patch fixes this problem fully.

Your patch is OK but it will leave the Hide the breadcrumb if the breadcrumb only contains the link to the front page not working. If you want the module to work as designed, you can use the patches in the issue queue. There is also at least one sandbox module for "menu breadcrumb" whose commit history shows patches for all the currently open issues.

rphair’s picture

rphair’s picture

Status: Active » Closed (duplicate)

Code from both patches referred to above now included in version 8.x-1.0-beta1.