Issue Bug Closed

#92726Routing leads to 404

Marc Lindemann 10/28/20, 09:15 updated 07/10/24, 19:39

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?

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 1

  1. Garvin Hicking commented and changed status New Closed assigned to Garvin Hicking 07/10/24, 19:39

    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.