Project

General

Profile

Actions

Bug #92726

closed

Routing leads to 404

Added by Marc Lindemann about 4 years ago. Updated 4 months ago.

Status:
Closed
Priority:
Should have
Category:
Site Handling, Site Sets & Routing
Target version:
Start date:
2020-10-28
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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?

Actions #1

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.

Actions

Also available in: Atom PDF