Project

General

Profile

Actions

Bug #97281

closed

RouteEnhancer for two extbase plugins using the same actions can't be resolved correctly

Added by Thorge Winkelmann over 2 years ago. Updated about 2 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
Site Handling, Site Sets & Routing
Target version:
-
Start date:
2022-04-01
Due date:
% Done:

0%

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

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.

For example, if you want to use one plugin for the list and show action and another exists only for the show action, so that you can link to another page for the detail view if needed.
  • 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!

Actions

Also available in: Atom PDF