Review main Abandoned

77181[FEATURE] Add requiresPluginOnPage option to ExtbasePluginEnhancer

Christoph Lehmann CR 0 V 0 Normal +86 −1 updated 09/17/26, 15:35

Commit message

Open ToDo
* Add rst + tests

This option helps when limitToPages does not fit your needs (editor are allowed to insert plugins) and you have multiple routeEnhancers having the same route path.

Problematic configuration:

routeEnhancers:
  News:
    type: Extbase
    extension: News
    plugin: NewsDetail
    routes:
      - routePath: '/'
        _controller: 'News::list'
      - routePath: '/{news-title}'
    aspects:
      news-title:
        type: PersistedAliasMapper
        tableName: tx_news_domain_model_news
        routeFieldName: path_segment
  Events:
    type: Extbase
    extension: EventExtension
    plugin: EventDetail
    routes:
      - routePath: '/{event-title}'
        _controller: 'Event::show'
        _arguments:
          event-title: event
    aspects:
      event-title:
        type: PersistedAliasMapper
        tableName: tx_eventextension_domain_model_event
        routeFieldName: slug

An event would never been shown on the events detail page when a news with the same slug exists. It leads to a 404 HTTP response.

Solution:

By adding the new option `requiresPluginOnPage` it is checked that the plugin `NewsDetail` or `Pi1` exists.

routeEnhancers:
  News:
    type: ExtbaseRequiringPluginOnPage
    extension: News
    plugin: NewsDetail
    requiresPluginOnPage: NewsDetail,Pi1

If none of the plugins is found on the current page, then the routeEnhancer is ignored and thus does it not tries to enhance the route.

Review

  • Code review CR 0
  • Verified V 0
    • core-ci +1 CI

Issues 1

Files 1

Review log 814

  1. Christoph Lehmann uploaded patch set 1 12/17/22, 09:35

  2. core-ci voted on patch set 1 V -1 12/17/22, 09:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/35212

  3. Christoph Lehmann uploaded patch set 2 V -1 12/17/22, 10:08

  4. Christoph Lehmann updated the commit message in patch set 3 12/17/22, 10:16

  5. core-ci voted on patch set 2 V -1 12/17/22, 10:21 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/35213

  6. Christoph Lehmann uploaded patch set 4 12/17/22, 10:26

  7. core-ci voted on patch set 3 V -1 12/17/22, 10:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/35214

  8. core-ci voted on patch set 4 V +1 12/17/22, 10:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/35215

  9. Christoph Lehmann updated the commit message in patch set 5 V +1 12/17/22, 10:39

  10. Christoph Lehmann marked it work in progress 12/17/22, 10:40

  11. core-ci voted on patch set 5 V +1 12/17/22, 10:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/35216

  12. Christoph Lehmann rebased onto patch set 6 V +1 03/25/23, 21:59

  13. core-ci voted on patch set 6 V +1 03/25/23, 22:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39631

  14. Georg Ringer abandoned the change 09/17/26, 15:35

    abondend in favor of #109263 which is part of 14.2