Issue Bug Closed

#87337ExtbasePluginEnhancer does not use a custom controller configuration

Guido Schmechel 01/05/19, 19:25 updated 12/23/19, 22:48

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'

Reviews 4