diff --git a/src/Plugin/Preprocess/Menu.php b/src/Plugin/Preprocess/Menu.php index 1acb497..f51b027 100644 --- a/src/Plugin/Preprocess/Menu.php +++ b/src/Plugin/Preprocess/Menu.php @@ -44,7 +44,7 @@ class Menu extends PreprocessBase implements PreprocessInterface { // If URL isn't a link, it's rendered as a element. Add the // "navbar-text" class so it doesn't disrupt the navbar items. // @see https://www.drupal.org/project/bootstrap/issues/3053464 - if ($item['url']->getRouteName() === '') { + if ($item['url']->isRouted() && $item['url']->getRouteName() === '') { $linkAttributes->addClass('navbar-text'); } }