Search code examples
typo3extbasetypo3-extensions

Route Enhancer for sf_event_mgt


I can't get the list route enhancer working for sf_event_mgt 5.0.1 in my TYPO3 10.4.6 installation. All the other routes seem to work (detail, registration etc.) but list, instead of just linking the list plugin page, generates a link to

/veranstaltungen-1?tx_sfeventmgt_pievent%5Baction%5D=list&tx_sfeventmgt_pievent%5Bcontroller%5D=Event&cHash=19b6ef72f7fdbb2f7bc9269ab3ea3446

I'm using the exact configuration provided in the extension documentation. (except for the page uids of course)

I've also tried adding a plugin route enhancer just for the list action like tx_news used to do, and change the list route to something else than "/" but to no avail.

EventList:
    type: Plugin
    routePath: '/{@widget_0/currentPage}'
    namespace: tx_sfeventmgt_pievent
     aspects:
      '@widget_0/currentPage':
        type: StaticRangeMapper
        start: '1'
        end: '1000'

as part of the sf_event_mgt config from the documentation:

…
routes:
      - { routePath: '/list/{page}', _controller: 'Event::list', _arguments: {'page': '@widget_0/currentPage'}  }
…

I didn't bother to check if the argument target is correct here, since the route doesn't work anyway, even without any arguments.

In contrast the route configuration for news works like a charm

NewsList:
    type: Plugin
    routePath: '/{@widget_0/currentPage}'
    namespace: tx_news_pi1
    aspects:
      '@widget_0/currentPage':
        type: StaticRangeMapper
        start: '1'
        end: '1000'

Help would be appreciated.


Solution

  • I'm the author of sf_event_mgt. I think there might be a problem with you routing configuration, since you define the key of the page aspect to be as @widget_0/currentPage (which includes a slash).

    The following configuration should work as expected with the latest version of the extension on TYPO3 10.4.6:

    EventPlugin:
      type: Extbase
      limitToPages: [3,4,5]
      extension: SfEventMgt
      plugin: Pievent
      routes:
        - { routePath: '/{page}', _controller: 'Event::list', _arguments: {page: '@widget_0/currentPage'} }
      defaultController: 'Event::list'
      defaults:
        page: '1'
      requirements:
        page: '\d+'
      aspects:
        page:
          type: StaticRangeMapper
          start: '1'
          end: '100'