Skip to content

UrlComparerTrait::_normalize throws #107

@nrother

Description

@nrother

When upgrading to 3.1 and using the BootstrapNavbarHelper a MissingRouteException will be thrown from RouteCollection::parse, originating from BootstrapNavbarHelper::_normalize. The error message is "A route matching "/http://localhost/test" could not be found." (note the slash at front!)

This is likely due to the changes to RouteCollection::parse in CakePHP 3.4.

Test code:

$nav = $this->BootstrapNavbar;
echo $nav->beginMenu();
echo $nav->link('Test', ['controller' => 'Test', 'action' => 'index']);
echo $nav->end();

I'm using CakePHP 3.4 and Bootstrap Helpers 3.1.

A simple fix is to disable automatic link activation:

$this->BootstrapNavbar->config('autoActiveLink', false);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions