Skip to content

_normalize is wrong when a page is attached to default route #160

@viniciusbig

Description

@viniciusbig

This is a (multiple allowed):

  • bug

  • enhancement

  • question

  • CakePHP Version: 3.5.14

  • Plugin Version/Branch: COMPOSER REQUIREMENTS (e.g. dev-master, dev-4.0.1-alpha, 3.1.*).

What you did

I have a route attached to a page called 'dashboard'

$routes->connect('/', ['controller' => 'Pages', 'action' => 'display', 'dashboard']);

So, using the Navbar help I've created a link like this:

$this->Navbar->link('Dashboard', ['controller' => 'Pages', 'action' => 'display', 'dashboard'])

And the generated link is '/' since its routed that way.

In another page, '/home', (pages/display/home)
the link '/' is marked as 'active' and this is wrong.

How can I check the current page properly?

What happened

I got the root page active even on another page.
Normalize functions seems not work properly when the URL is attached to '/' route.

What you expected to happen

Normalize should check the URL in routes and consider it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions