Bug #97281
closedRouteEnhancer for two extbase plugins using the same actions can't be resolved correctly
0%
Description
Bug description:
There seems to be a bug with the Sites Config for Extbase extensions if you have two plugins that use the same actions. I don't think it only occurs in TYPO3 10 but also in other versions.
- If the plugin for the show action is first in the config, it works, but the other plugin only shows the list action despite a correct link.
- If the other plugin (the one with the list and show) comes first, the show action in this plugin works, but the other plugin shows an error because the record is missing.
The links are built correctly in both cases, but do not seem to be resolved correctly. The attribute "plugin" is apparently only taken into account for generating the URLs, but not for resolving them. The system always seems to use the first entry for the combination of extension and action, even if it does not match the plugin that is used on the page.
It only works if limitToPages is used in the configuration of the first plugin, but this is not always an option.
Example Config:
Detail Plugin:
ExampleDetailPlugin:
type: Extbase
extension: Example
plugin: ExampleDetail
routes:
-
routePath: '/{record}'
_controller: 'Example::show'
_arguments:
record: record
requirements:
record: '^[a-zA-Z0-9].*$'
aspects:
record:
type: PersistedAliasMapper
tableName: tx_example_domain_model_record
routeFieldName: slug
List Plugin:
ExampleListPlugin:
type: Extbase
extension: Example
plugin: ExampleList
routes:
-
routePath: '/'
_controller: 'Example::list'
-
routePath: '/{record}'
_controller: 'Example::show'
_arguments:
record: record
requirements:
record: '^[a-zA-Z0-9].*$'
aspects:
record:
type: PersistedAliasMapper
tableName: tx_example_domain_model_record
routeFieldName: slug
A possible solution maybe:
Perhaps it would be possible to find the record in the database using the slug and then search the page for a plugin in tt_content that is part of the extension to which the record belongs. If there is one you could resolve the url for that plugin. Otherwise you could do the same as you do now.
Thank you for reading!