Closed milo closed 5 years ago
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.
InvalidLinkException
No route for Auth:Sign:in()
match()
constructUrl()
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 https://github.com/nette/routing/blob/603c697f3df7ed214795d4e8e8c58fbf981232b1/src/Routing/RouteList.php#L105-L108 and found, that $key = null because $params['module'] is not set and $params['presenter'] === 'Auth:Sign' for example.
$key = null
$params['module']
$params['presenter'] === 'Auth:Sign'
Not sure it is an intention.
I hope the fix will work. Parameter module is big problem.
module
Description
I'm migrating app to Nette v3 and I'm getting
InvalidLinkException
withNo route for Auth:Sign:in()
. Thematch()
pass and presenter runs, but building links byconstructUrl()
fails.Steps To Reproduce
Router factory looks like:
and I had to rewrite routes as follow to get it work.
I digged out to https://github.com/nette/routing/blob/603c697f3df7ed214795d4e8e8c58fbf981232b1/src/Routing/RouteList.php#L105-L108 and found, that
$key = null
because$params['module']
is not set and$params['presenter'] === 'Auth:Sign'
for example.Not sure it is an intention.