Project

General

Profile

Actions

Bug #91333

closed

routeEnhancer of type Extbase with multiple routePaths and various argument with same controller and action are broken since Typo3 9.5.14

Added by Robert Wolle almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2020-05-07
Due date:
% Done:

0%

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

Description

The given routeEnhancer configuration does not work in our multisite anymore:

routeEnhancers:
  PageTypeSuffix:
    type: PageType
    default: /
    index: ''
  NewsPlugin:
    type: Extbase
    extension: News
    plugin: Pi1
    routes:
      # Pagination:
      - routePath: '/seite-{page}'
        _controller: 'News::list'
        _arguments:
          page: '@widget_0/currentPage'
      # detail
      - routePath: '/news/{news_title}'
        _controller: 'News::detail'
        _arguments:
          news_title: news
      # Date year:
      - routePath: '/{date_year}'
        _controller: 'News::list'
        _arguments:
          date_month: 'overwriteDemand/month'
          date_year: 'overwriteDemand/year'
      # Date year + pagination:
      - routePath: '/{date_year}/seite-{page}'
        _controller: 'News::list'
        _arguments:
          date_year: 'overwriteDemand/year'
          page: '@widget_0/currentPage'
      # Date year/month:
      - routePath: '/{date_year}/{date_month}'
        _controller: 'News::list'
        _arguments:
          date_month: 'overwriteDemand/month'
          date_year: 'overwriteDemand/year'
      # Date year/month + pagination:
      - routePath: '/{date_year}/{date_month}/seite-{page}'
        _controller: 'News::list'
        _arguments:
          date_month: 'overwriteDemand/month'
          date_year: 'overwriteDemand/year'
          page: '@widget_0/currentPage'
    requirements:
      page: '\d+'
      date_month: '\d+'
      date_year: '\d+'
    defaultController: 'News::list'
    defaults:
      page: '1'
      date_month: ''
      date_year: ''
    aspects:
      news_title:
        type: PersistedAliasMapper
        tableName: tx_news_domain_model_news
        routeFieldName: path_segment
      page:
        type: StaticRangeMapper
        start: '1'
        end: '100'
      date_month:
        type: StaticValueMapper
        map:
          januar: '01'
          februar: '02'
          maerz: '03'
          april: '04'
          mai: '05'
          juni: '06'
          juli: '07'
          august: '08'
          september: '09'
          oktober: '10'
          november: '11'
          dezember: '12'
      date_year:
        type: StaticRangeMapper
        start: '2016'
        end: '2020'

With the given example the url path is like https://www.domain.tld/news///seite-2/ in a pagination navigation.

So the routeEnhancer uses the last pathRoute always:

# Date year/month + pagination:
      - routePath: '/{date_year}/{date_month}/seite-{page}'
        _controller: 'News::list'
        _arguments:
          date_month: 'overwriteDemand/month'
          date_year: 'overwriteDemand/year'
          page: '@widget_0/currentPage'

If I change the position of the "# Pagination:" part to the bottom, it'll work, but the rest does not in general.


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