Bug #91098
openRouting and RouteEnhancer problems
0%
Description
The 9.5 routing and the route enhancers seem to have some problems or at least don't behave as expected comparing to Symfony/Laravel.
I've used this configuration for testing:
routeEnhancers: Aimeos: type: Extbase namespace: ai limitToPages: [90] defaultController: 'Catalog::list' routes: - { routePath: '/{d_name}', _controller: 'Catalog::detail' } - { routePath: '/{d_name}/{d_pos}', _controller: 'Catalog::detail' } requirements: d_pos: '[0-9]*'
First observation: Routes are tested in reverse order, not from top to bottom. This doesn't make sense since the routes are not sorted by their path length and longer paths are not tried first.
When testing the rules with different parameters I get unexpected results:
URL: http://127.0.0.1:8000/your-shop/shop/detail?ai%5Bd_name%5D=Demo-selection-article&ai%5Bd_pos%5D=1
Expected: http://127.0.0.1:8000/your-shop/shop/detail/Demo-selection-article/1
Result: http://127.0.0.1:8000/your-shop/shop/detail/Demo-selection-article/1
URL: http://127.0.0.1:8000/your-shop/shop/detail?ai%5Bd_name%5D=Demo-selection-article
Expected: http://127.0.0.1:8000/your-shop/shop/detail/Demo-selection-article
Result: Exception that the ai[d_pos] parameter is missing because it doesn't test the next rule (/{d_name})
URL: http://127.0.0.1:8000/your-shop/shop/detail?ai%5Bd_name%5D=Demo-selection-article&ai%5Bd_pos%5D=
Expected: http://127.0.0.1:8000/your-shop/shop/detail/Demo-selection-article/
Result: Exception "Parameter "ai__d_pos" for route "ai_1" must match "[^/]++" ("" given) to generate a corresponding URL."