Project

General

Profile

Actions

Bug #87337

closed

ExtbasePluginEnhancer does not use a custom controller configuration

Added by Guido Schmechel over 5 years ago. Updated over 4 years ago.

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

100%

Estimated time:
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'

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #87668: Revert "ExtbasePluginEnhancer does not use a custom controller configuration"ClosedBenni Mack2019-02-07

Actions
Actions

Also available in: Atom PDF