Unverified Commit 51bf1374 authored by Mark Halliwell's avatar Mark Halliwell
Browse files

Issue #3053464 by markcarver, intrafusion: Menu path route:<nolink> breaks style



Signed-off-by: default avatarMark Carver <mark.carver@me.com>
parent abd91b3e
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -40,6 +40,13 @@ class Menu extends PreprocessBase implements PreprocessInterface {
        $wrapperAttributes->setAttributes($item['url']->getOption('wrapper_attributes') ?: []);
        $wrapperAttributes->setAttributes($item['url']->getOption('container_attributes') ?: []);
        $linkAttributes->setAttributes($item['url']->getOption('attributes') ?: []);
        
        // If URL isn't a link, it's rendered as a <span> 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() === '<nolink>') {
          $linkAttributes->addClass('navbar-text');
        }
      }

      // Unfortunately, in newer core/Twig versions, only certain classes are