-
-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Description
- bug report? yes
- version: 603c697
Description
I'm migrating app to Nette v3 and I'm getting InvalidLinkException with No route for Auth:Sign:in(). The match() pass and presenter runs, but building links by constructUrl() fails.
Steps To Reproduce
Router factory looks like:
$router = new RouteList;
$router[] = new Route('auth/<presenter>[/<action>[/<id>]]', [
'module' => 'Auth',
'presenter' => 'Homepage',
'action' => 'default',
]);
$router[] = new Route('<presenter>[/<action>[/<id>]]', [
'module' => 'Default',
'presenter' => 'Homepage',
'action' => 'default',
]);and I had to rewrite routes as follow to get it work.
$router = new RouteList;
$router->withModule('Auth')->addRoute('auth/<presenter>[/<action>[/<id>]]', [
'presenter' => 'Homepage',
'action' => 'default',
]);
$router->withModule('Default')->addRoute('<presenter>[/<action>[/<id>]]', [
'presenter' => 'Homepage',
'action' => 'default',
]);I digged out to
routing/src/Routing/RouteList.php
Lines 105 to 108 in 603c697
| $key = $params[$this->cacheKey] ?? null; | |
| if (!is_scalar($key) || !isset($this->ranks[$key])) { | |
| $key = '*'; | |
| } |
$key = null because $params['module'] is not set and $params['presenter'] === 'Auth:Sign' for example.
Not sure it is an intention.
Metadata
Metadata
Assignees
Labels
No labels