contributte / menu-control

🍔 Menu and breadcrumb components for Nette framework (@nette)
MIT License
29 stars 20 forks source link

Why is the reverse logic in MenuItem.php isActive () at line 89 ? #42

Closed jerabina closed 4 years ago

jerabina commented 4 years ago
if (!$this->include) {
    $actionName = sprintf('%s:%s', $presenter->getName(), $presenter->getAction());
    foreach ($this->include as $include) {
        if (preg_match(sprintf('~%s~', $include), $actionName)) {
            return $this->active = true;
        }
    }
}
foxycode commented 4 years ago

@jerabina Looks like a bug. Can you create PR with test?

foxycode commented 4 years ago

@f3l1x I need your help.

f3l1x commented 4 years ago

I'll put it on my todo-list.

foxycode commented 4 years ago

Looks like a Nette bug, fixed in commit https://github.com/contributte/menu-control/commit/f606e8f42407066aaf7877f367fcd5f42c9e36ed

@jerabina Sorry it took so long.