Bug #87337

ExtbasePluginEnhancer does not use a custom controller configuration

Added by Guido Schmechel 16 days ago. Updated 16 days ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2019-01-05
Due date:
% Done:

0%

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

Description

Context
I have a standard extbase plugin. Actions are list, detail and city.

Problem
If defaultController and _controller do not match from a route, the URL will not build up cleanly. In my case, he always uses "list" to generate the URL.

Solution
When verifying each configuration in the ExtbasePluginEnhancer, the controller will not overwrite the current configuration. Only the default controller is used.

if (!empty($configuration['_controller'])) {
    $this->applyControllerActionValues(
        $configuration['_controller'],
        $originalParameters[$this->namespace]
    );
}

Route Enhancer config

routeEnhancers:
  DetailPoi:
    type: Extbase
    extension: AyacooPoi
    plugin: Poi
    routes:
      - { routePath: 'restaurant/{slug}', _controller: 'Poi::detail', _arguments: {'slug' : 'poi'} }
      - { routePath: 'stadt/{cityTitle}', _controller: 'Poi::city', _arguments: {'cityTitle' : 'city'} }
    defaultController: 'Poi::list'
    requirements:
      poi: '\d+'
      city: '\d+'
    aspects:
      slug:
        type: PersistedAliasMapper
        tableName: 'tx_ayacoopoi_domain_model_poi'
        routeFieldName: 'slug'
      cityTitle:
        type: PersistedAliasMapper
        tableName: 'tx_ayacoopoi_domain_model_poi'
        routeFieldName: 'city'

History

#1 Updated by Gerrit Code Review 16 days ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59343

Also available in: Atom PDF