Bug #92726
closedRouting leads to 404
0%
Description
With changes from https://github.com/TYPO3/TYPO3.CMS/commit/e98ba4a4a843ae989058560fa52707ebe9ba481d
our working config leads now to a 404.
f. ex.
/de/produkt/testcategory/testproduct -> 404
/de/produkt/testcategory -> 200
Products:
type: Extbase
extension:Products
plugin: Page
routes:
- routePath: '/{category}/{product_title}'
_controller: 'Product::show'
_arguments:
category: category
product_title: product
defaultController: 'Product::show'
aspects:
category:
type: PersistedAliasMapper
tableName: 'tx_products_domain_model_category'
routeFieldName: 'url_path'
product_title:
type: PersistedAliasMapper
tableName: 'tx_products_domain_model_product'
routeFieldName: 'url_path'
defaults:
category: ''
product_title: ''
requirements:
category: '[a-zA-Z0-9].*'
product_title: '[a-zA-Z0-9].*'
is this yaml configuration wrong? was this a side effect that never should be working? or is this now a bug?
Updated by Garvin Hicking 4 months ago
- Status changed from New to Closed
- Assignee set to Garvin Hicking
Sorry this went under the radar for so long.
I believe your problem is the regular expression for the requirements:
[a-zA-Z0-9].*
The dot here is problematic, you probably need to remove it. Because with it, for your first part of the URL everything INCLUDING a slash is matched.
That would match "testcategory/testproduct" as "category", and an empty product_title. Thats not matchable.
By removing the dot, only a-z0-9 are allowed, and no slash.
Couldn't verify this but I feel confident - please let me know if this is a mistake and we can reopen and discuss further.