Project

General

Profile

Actions

Bug #91098

open

Routing and RouteEnhancer problems

Added by Aimeos no-lastname-given about 4 years ago. Updated almost 4 years ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2020-06-23
Due date:
% Done:

0%

Estimated time:
(Total: 0.00 h)
TYPO3 Version:
9
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Sprint Focus:

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."


Subtasks 2 (2 open0 closed)

Task #91702: Evaluate possibility for optional route partsNewOliver Hader2020-06-23

Actions
Task #91703: Add configuration guard for ambiguous literals in route pathsNewOliver Hader2020-06-23

Actions

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #90924: Maximum route parameters always appendedClosed2020-04-01

Actions
Actions

Also available in: Atom PDF