'Routeenhancer typo3 extension with 2 plugin

I develop a Typo3 extension with 2 plugin

This is my ext_localconf.php

call_user_func(
    function()
    {

        \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
            'Didattica',
            'Lauree',
            [
                \Polimi\Didattica\Controller\ElencocdsController::class => 'lauree,detail',
            ],
            // non-cacheable actions
            [
                \Polimi\Didattica\Controller\ElencocdsController::class => 'lauree,detail',
            ]
        );

        \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
            'Didattica',
            'Laureemagistrali',
            [
                \Polimi\Didattica\Controller\ElencocdsmagController::class => 'laureemagistrali,detail',
            ],
            // non-cacheable actions
            [
                \Polimi\Didattica\Controller\ElencocdsmagController::class => 'laureemagistrali,detail',
            ]
        );

I tried to add a routeenhancer for my extension

routeEnhancers:
  Elencocds:
    type: Extbase
    extension: Didattica
    plugin: Lauree
    routes:
      - routePath: '{name}'
        _controller: 'Elencocds::detail'
        _arguments:
          name: elencocds
    defaultController: 'Elencocds::detail'
    defaults:
      page: '1'
    requirements:
      page: \d+
    aspects:
      name:
        type: PersistedPatternMapper
        tableName: tx_didattica_domain_model_elencocds
        routeFieldPattern: ^(?<slug>.+)$
        routeFieldResult: '{slug}'

  Elencocdsmag:
    type: Extbase
    extension: Didattica
    plugin: Laureemagistrali
    routes:
      - routePath: '{name}'
        _controller: 'Elencocdsmag::detail'
        _arguments:
          name: elencocds
    defaultController: 'Elencocdsmag::detail'
    defaults:
      page: '1'
    requirements:
      page: \d+
    aspects:
      name:
        type: PersistedPatternMapper
        tableName: tx_didattica_domain_model_elencocds
        routeFieldPattern: ^(?<slug>.+)$
        routeFieldResult: '{slug}'

    

the first plugin works fine.

the second plugin correctly displays the "converted" url, but remains stationary in the "laureemagistrali" action, and does not apply the "detail" action. Seems it does not nothing.

What am I doing wrong?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source