ZF-8428: Zend_Controller_Router_Route_Chain should call setMatchedPath($path)
Description
It is currently not possible to chain more than two routes.Example with 3 routes:
$route = new Zend_Controller_Router_Route('example', array('controller' => 'error', 'action' => 'error'));
$route2 = new Zend_Controller_Router_Route('buggy');
$route3 = new Zend_Controller_Router_Route('url');
$chain = $route->chain($route2->chain($route3));
$router->addRoute('example_route', $chain);
The route above does not match "example/buggy/url".
This is because Zend_Controller_Router_Route_Chain does not call setMatchedPath($path), meaning that the outer chain thinks that the inner chain did not match.
It seems tat this can be solved by calling $this->setMatchedPath($path) in match.
Comments
Posted by Edward Surov (zooh) on 2009-12-16T14:20:22.000+0000
Route doesn't match because 'url' != 'route'.
Posted by Ismo Toijala (itoijala) on 2009-12-16T22:47:57.000+0000
Sorry about that typo. It doesn't match "example/buggy/url" either. It works if I add the line to Zend_Controller_Router_Route_Chain.
Posted by Victor Gryshko (hohol) on 2011-05-20T09:46:53.000+0000
To fix this you have to change the following:
with the following: