Review main Merged

92578[FEATURE] Add PSR-14 event to modify indexed_search result sets

Eric Harrer CR +2 V +2 Hard +320 −12 updated 02/23/26, 19:54

Commit message

Adds a new PSR-14 event that allows modifying complete search
result sets in indexed_search.

The event is dispatched once in SearchController->searchAction()
after all result sets have been built. Listeners can update
pagination and other result-set data in a single place.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Garvin Hicking +1
    • Sven Liebert +1
  • Verified V +2 Done
    • Benni Mack +2
    • Garvin Hicking +1
    • Sven Liebert +1
    • core-ci +1 CI

Issues 1

Files 6

Review log 2534

Show 69 earlier messages
  1. Eric Harrer uploaded patch set 1 01/29/26, 20:10

  2. Guido Schmechel commented on patch set 1 01/29/26, 20:19

    Quick question: Wouldn't it make more sense to incorporate a setting for this? EXT:indexed_search already has many settings, and that would be more integrator-friendly than building an event listener?
  3. Eric Harrer commented on patch set 1 01/29/26, 20:31

    Reply

    A setting would work for selecting between predefined options. The PSR-14 event is intended to allow fully custom pagination implementations, which would not be feasible with a simple setting. From my experience, PSR-14 events are also increasingly used by integrators today, making this a familiar and flexible extension point.
  4. core-ci voted on patch set 1 V -1 01/29/26, 20:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94597

  5. Eric Harrer uploaded patch set 2 V -1 01/29/26, 20:52

  6. core-ci voted on patch set 2 V +1 01/29/26, 21:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94602

  7. Eric Harrer uploaded patch set 3 V +1 01/29/26, 21:55

  8. core-ci voted on patch set 3 V +1 01/29/26, 22:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94606

  9. Garvin Hicking commented on patch set 3 01/30/26, 10:53

    Reply

    Personally, I think I would opt for a setting. If we introduce a PSR-14 event we might make it more broadly available and dispatch it to work on the whole `$resultsets` within `SearchController->searchAction()`. That would allow to not only influence the paginatior, but other aspects of results too. A benefit would also be that the PSR event would only be called once for the search, and not X times. And the event listener can then decide whether to iterate all resultssets or only portions of it. That said, I think having PSR-14 events is helpful. We could even implement the setting then with a PSR-14 eventlistener.
  1. Guido Schmechel commented on patch set 3 02/07/26, 12:57

    Reply

    I think that's a good approach. Think a little bigger with this patch to influence the complete search. And for pagination, a setting in a separate patch.
  2. Eric Harrer uploaded patch set 4 V +1 02/19/26, 11:26

  3. Eric Harrer commented on patch set 4 02/19/26, 11:31

    Thank you for the valuable feedback so far. This patchset has been updated accordingly: the event now targets complete indexed_search result sets, and tests/changelog were aligned with that broader scope. A new Forge issue has been created for this foundational extension point (#109018). The original issue (#105084) will be resolved by a dedicated follow-up patch introducing the integrator-facing setting on top of this API.
  4. core-ci voted on patch set 4 V +1 02/19/26, 11:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96237

  5. Eric Harrer rebased onto patch set 5 V +1 02/19/26, 13:22

  6. Eric Harrer commented on patch set 5 02/19/26, 13:24

    The setting patch based on this patch can be found here: https://review.typo3.org/c/Packages/TYPO3.CMS/+/92896
  7. core-ci voted on patch set 5 V +1 02/19/26, 13:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96245

  8. Garvin Hicking commented on patch set 5 02/19/26, 19:30

    Feature-109018-AddPSR-14EventToModifyIndexedSearchResultSets.rst:26

    In an ideal world we would have a ResultSet be a DTO that we could replace, and not a generic array. In this case for indexed_search this would be a larger task not needed for the context here so I guess we can live with this global "setArray" approach.

    SearchController.php:234

    Just a note: We normaly do not create such intermediate methods, but in this context to provide testability I find it acceptable to have it "wrapped".
  9. Garvin Hicking voted on patch set 5 CR +1 V +1 02/19/26, 19:31

  10. Eric Harrer rebased onto patch set 6 CR +1 V +1 02/20/26, 13:30

  11. core-ci voted on patch set 6 V +1 02/20/26, 14:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96352

  12. Eric Harrer rebased onto patch set 7 V +1 02/20/26, 15:04

  13. core-ci voted on patch set 7 V +1 02/20/26, 15:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96366

  14. Garvin Hicking voted on patch set 7 CR +1 V +1 02/20/26, 15:45

  15. Sven Liebert voted on patch set 7 CR +1 V +1 02/23/26, 18:01

  16. Benni Mack voted on patch set 7 CR -2 02/23/26, 18:01

  17. Benni Mack uploaded patch set 8 CR +1 V +1 02/23/26, 18:29

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  18. Benni Mack commented on patch set 8 CR 0 02/23/26, 18:30

    sorry, I couldn't resist and did some "minor" adjustments (if you ever going to use this new Event, you won't regret it)
  19. core-ci voted on patch set 8 V +1 02/23/26, 18:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96611

  20. Garvin Hicking uploaded patch set 9 V +1 02/23/26, 19:05

    rename all the things
  21. core-ci voted on patch set 9 V +1 02/23/26, 19:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96612

  22. Garvin Hicking commented on patch set 9 CR +1 V +1 02/23/26, 19:28

    Reply

    ... but we have $GLOBALS[TYPO3_REQUEST]! J/k. Thanks for this addition and the better name.
  23. Sven Liebert voted on patch set 9 CR +1 V +1 02/23/26, 19:39

  24. Benni Mack voted on patch set 9 CR +2 V +2 02/23/26, 19:54

  25. Benni Mack merged patch set 10 02/23/26, 19:54