After upgrading to TYPO3 v9.5.14 our detail pages for news crash with the exception
Symfony\Component\Routing\Exception\InvalidParameterException
Parameter "p88bd715a41119d0e8087a5d19cb049" for route "tx_news_pi1_1" must match "[^/]++" ("" given) to generate a corresponding URL.
What's going on?
The site used this configuration:
NewsTagPlugin:
type: Extbase
limitToPages: [14]
extension: News
plugin: Pi1
routes:
- routePath: '/{tag-name}'
_controller: 'News::list'
_arguments:
tag-name: 'overwriteDemand/tags'
- routePath: '/{tag-name}/page/{page}'
_controller: 'News::list'
_arguments:
tag-name: 'overwriteDemand/tags'
page: '@widget_0/currentPage'
requirements:
page: '\d+'
defaultController: 'News::list'
defaults:
page: ''
aspects:
page:
type: IntegerMapper
start: 1
end: 5000
tag-name:
type: PersistedAliasMapper
tableName: tx_news_domain_model_tag
routeFieldName: slug
NewsTagPlugin:
...
routes:
...
- routePath: '/{tag-name}/page/{page}'
_controller: 'News::list'
_arguments:
tag-name: 'overwriteDemand/tags'
page: '@widget_0/currentPage'
requirements:
page: '\d+'
_arguments
defines a mapping for route parameter and internal variables (e.g. as query parameter`requirements
is wrong here, since it shall not be used as argument mappingrequirements
need to be defined on the root level of NewsTagPlugin
NewsTagPlugin:
...
routes:
...
- routePath: '/{tag-name}/page/{page}'
...
defaults:
page: ''
aspects:
...
defaults
was not applied prior to TYPO3 v9.5.14 and addressed in https://review.typo3.org/c/Packages/TYPO3.CMS/+/60361page
does not make much sense and would lead to an URL like /some-tag/page/
which is causing the error message shown in the answerpage: 1
/some-tag/page/
) this needs to be defined explicitly using {!page}
in the route path NewsTagPlugin:
type: Extbase
limitToPages: [14]
extension: News
plugin: Pi1
routes:
- routePath: '/{tag-name}'
_controller: 'News::list'
_arguments:
tag-name: 'overwriteDemand/tags'
- routePath: '/{tag-name}/page/{!page}'
_controller: 'News::list'
_arguments:
tag-name: 'overwriteDemand/tags'
page: '@widget_0/currentPage'
defaultController: 'News::list'
defaults:
page: 1
aspects:
page:
type: IntegerMapper
start: 1
end: 5000
tag-name:
type: PersistedAliasMapper
tableName: tx_news_domain_model_tag
routeFieldName: slug
IntegerMapper
seems to be a custom aspect implementation - not being available to the public