80436[FEATURE] Introduce new PSR-14 `BeforeLiveSearchFormIsBuiltEvent`
Commit message
Review
-
Code review CR +2 Done
- Georg Ringer +2
- Andreas Kienast +1
-
Verified V +2 Done
- Georg Ringer +2
- Andreas Kienast +1
- core-ci +1 CI
Issues 1
Files 8
- typo3/sysext/backend/Classes/Controller/LiveSearchController.php12+14 −2
- typo3/sysext/backend/Classes/Search/Event/BeforeLiveSearchFormIsBuiltEvent.phpnew+107 −0
- typo3/sysext/backend/Tests/Functional/Controller/LiveSearchControllerTest.php3new+162 −0
- typo3/sysext/backend/Tests/Functional/Fixtures/Extensions/test_live_search_controller_events/Resources/Private/Language/locallang_misc.xlf2new+11 −0
- typo3/sysext/backend/Tests/Functional/Fixtures/Extensions/test_live_search_controller_events/composer.jsonnew+14 −0
- typo3/sysext/backend/Tests/Functional/Fixtures/Extensions/test_live_search_controller_events/ext_emconf.phpnew+21 −0
- typo3/sysext/backend/Tests/Unit/Search/Event/BeforeLiveSearchFormIsBuiltEventTest.phpnew+186 −0
- typo3/sysext/core/Documentation/Changelog/14.0/Feature-99409-NewPSR-14BeforeLiveSearchFormIsBuiltEvent.rstnew+68 −0
Review log 7396
Show 5471 earlier messages
-
Guido Schmechel uploaded patch set 1 08/07/23, 22:06
-
core-ci voted on patch set 1 V +1 08/07/23, 22:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45204
-
Oli Bartsch commented on patch set 1 CR -1 08/07/23, 22:32
Could we have some basic test for the new event?ModifyHintsInLiveSearchEvent.php:21hints in theModifyHintsInLiveSearchEvent.php:33For convenience, let's add an `addHint` / `setHint` method.Feature-99409-AddPSR-14EventForLivesearchHints.rst:6live searchFeature-99409-AddPSR-14EventForLivesearchHints.rst:16live searchFeature-99409-AddPSR-14EventForLivesearchHints.rst:30Suggest to replace this with "Backend\Search"Feature-99409-AddPSR-14EventForLivesearchHints.rst:50live searchFeature-99409-AddPSR-14EventForLivesearchHints.rst:53ext:backend -
Guido Schmechel uploaded patch set 2
CR -1V +108/08/23, 20:40 -
core-ci voted on patch set 2 V +1 08/08/23, 20:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45263
-
Guido Schmechel commented on patch set 2 CR -1 08/08/23, 20:48
On itModifyHintsInLiveSearchEvent.php:21ReplyDoneModifyHintsInLiveSearchEvent.php:33ReplyDoneFeature-99409-AddPSR-14EventForLivesearchHints.rst:6ReplyDoneFeature-99409-AddPSR-14EventForLivesearchHints.rst:16ReplyDoneFeature-99409-AddPSR-14EventForLivesearchHints.rst:30ReplyDoneFeature-99409-AddPSR-14EventForLivesearchHints.rst:50ReplyDoneFeature-99409-AddPSR-14EventForLivesearchHints.rst:53ReplyDone -
Guido Schmechel updated the commit message in patch set 3
CR -1V +108/08/23, 21:22 -
Guido Schmechel uploaded patch set 4 08/08/23, 21:23
-
core-ci voted on patch set 3 V +1 08/08/23, 21:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45265
-
core-ci voted on patch set 4 V +1 08/08/23, 21:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45266
-
Guido Schmechel commented on patch set 4 08/08/23, 21:33
Reply
Done -
Jörg Bösche voted on patch set 4 CR +1 08/10/23, 12:58
-
Simon Schaufelberger voted on patch set 4 CR +1 08/25/23, 17:59
-
Thomas Hohn voted on patch set 4 CR +1 09/14/23, 04:35
-
Stefan Bürk commented on patch set 4 CR -1 09/22/23, 15:55
LiveSearchController.php:83Maybe we should dispatch the event later, rename it a little bit and add additional values to the event so it can be adjusted: * `$request`: should be added in any cases, gives more context to the event to react dynamiclly in the event listener * `$searchDemand` so it adjusted by extension developers Not sure about `$searchProviders` ... -
Stefan Bürk commented on patch set 4 09/22/23, 15:58
ModifyHintsInLiveSearchEvent.php:29We should add a `@return string[]` here not sure if that is correct, but I guess Oliver Klee may be come up with a better one. Same for `setHints()` argument `$hints`. -
Oliver Klee commented on patch set 4 09/22/23, 16:11
ModifyHintsInLiveSearchEvent.php:29ReplyWe can be even more specific here (as the controller has full control over what data the event gets) and use `list<non-empty-string>`. -
Guido Schmechel commented on patch set 4 09/22/23, 16:33
LiveSearchController.php:83ReplyWhere could you imagine having a connection between hints and context? In live mode, please take out the hint on xyz? Have you thought of something like that? Moving it further down is basically no problem. I don't have the imagination for the searchProviders at the moment, but in the best case I'd probably like more information in one event ;-) Just for my understanding: I have a feeling you're not just thinking about the hints, but something bigger to modify more stuff? -
Guido Schmechel commented on patch set 4 09/22/23, 16:36
LiveSearchController.php:83ReplyIf you want to modify the search, there is, for example, this event: https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/Events/Events/Backend/ModifyQueryForLiveSearchEvent.html -
Stefan Bürk commented on patch set 4 09/22/23, 16:50
LiveSearchController.php:83ReplyHint based on "active" searchProviders or because of some request things ? Not really a use case, but try to come up which may some would need. We often have the issue that at some point no request is available, but needed for someone. So at least the request should be passed along to avoid using $GLOBALS['TYPO3_REQUEST'] in the event listener if needed. Therefore, I would make that event here more a generic event to define what should end up in the view. That way, someone can use the event to do that instead of xclassing the controller. Therefore, an additional "viewData" array may be usefull. Just thinking ... not played around with the LiveSearch on my own. But avoiding a "named" event and having later another one is contra-productive .. and there is no much handling logic, so having here a more "ModifyLiveSearchFormActionViewData" event would be more suitable for a lot more possible use-cases. What do you think ? -
Guido Schmechel commented on patch set 4 CR -1 09/22/23, 17:21
LiveSearchController.php:83ReplyNo problem, I was just looking for an understanding. For me, the hints have been sufficient so far. For the name, I would go for ModifyLiveSearchFormData, but that's debatable ;-) Thanks for your feedback. I'll try to work it in. -
Guido Schmechel uploaded patch set 5
CR +1V +109/22/23, 20:40 -
core-ci voted on patch set 5 V -1 09/22/23, 20:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47103
-
Guido Schmechel uploaded patch set 6
V -109/22/23, 20:53 -
core-ci voted on patch set 6 V -1 09/22/23, 21:00 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47104
-
Guido Schmechel uploaded patch set 7
V -109/22/23, 21:04 -
core-ci voted on patch set 7 V +1 09/22/23, 21:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47105
-
Stefan Bürk commented on patch set 7 09/22/23, 21:11
Feature-99409-AddPSR-14EventForLiveSearchForm.rst:26Use normal dashes here to have the example as a sub-category for Description please. ``` Example ------- ``` -
Stefan Bürk commented on patch set 7 09/22/23, 21:13
And we should add some functional tests: * ensure that the event is dispatched if the formAction is called (a event listener can catch the event) * check that when a event listener is changing something, for example adding custom hints, that it is added in the output and similar things -
Guido Schmechel commented on patch set 7 09/24/23, 13:22
Reply
I took a look at the whole thing. I don't have the testing experience for dispatching. Especially in relation to calling a backend function like the formAction. Maybe you have a similar test somewhere in the core for inspiration. But my problem with the formAction remains ;-) We have a unit test for changing the hints. In my opinion, that should be enough, since we have no external data reference, such as a database. How do you see this? -
Stefan Bürk commented on patch set 7 CR -1 09/25/23, 08:53
-1 will take care of the additional tests the next daysReply
-1 will take care of the additional tests the next days -
Stefan Bürk uploaded patch set 8
CR -1V +109/26/23, 15:26 -
Stefan Bürk voted on patch set 8 CR -1 09/26/23, 15:29
-
core-ci voted on patch set 8 V +1 09/26/23, 15:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47190
-
Stefan Bürk uploaded patch set 9
CR -1V +109/26/23, 16:04 -
Stefan Bürk commented on patch set 9 09/26/23, 16:07
Reply
Added some functional tests to cover the real dispatching.Reply
DoneFeature-99409-AddPSR-14EventForLiveSearchForm.rst:26ReplyDone -
core-ci voted on patch set 9 V +1 09/26/23, 16:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47192
-
Oliver Klee commented on patch set 9 09/26/23, 16:17
ModifyHintsInLiveSearchEvent.php:29ReplyDone -
Andreas Kienast commented on patch set 9 09/27/23, 12:11
LiveSearchControllerTest.php:106I think we can drop this check. If `$lastEventObject` is an instance of `ModifyLiveSearchFormDataEvent`, this assertion is always true. If not, the previous assertion will fail anyway. -
Stefan Bürk commented on patch set 9 09/27/23, 13:15
LiveSearchControllerTest.php:106ReplyAck -
Stefan Bürk uploaded patch set 10
V +109/27/23, 13:16 -
Stefan Bürk commented on patch set 10 09/27/23, 13:16
LiveSearchControllerTest.php:106ReplyDone -
core-ci voted on patch set 10 V -1 09/27/23, 13:23 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47244
-
Stefan Bürk uploaded patch set 11
V -109/28/23, 15:25 -
core-ci voted on patch set 11 V +1 09/28/23, 15:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47291
-
Oliver Klee voted on patch set 11 V +1 09/28/23, 15:57
-
Stefan Bürk voted on patch set 11 V +1 CR +1 09/29/23, 10:53
-
Oli Bartsch commented on patch set 11 09/29/23, 13:30
LiveSearchController.php:88Since the created object is only used in the event, lets create it in the event's constructor instead.LiveSearchController.php:89So should we not just make this property optional by defining a default value in the event's contructor? -
Simon Schaufelberger commented on patch set 11 CR -1 10/01/23, 09:37
locallang_misc.xlf:3product-name needs to be the extension name which is test_live_search_controller_events in this case. -
Stefan Bürk uploaded patch set 12
CR +1V +110/05/23, 09:15 -
Stefan Bürk commented on patch set 12 10/05/23, 09:15
LiveSearchController.php:88ReplyDoneLiveSearchController.php:89ReplyDonelocallang_misc.xlf:3ReplyDone -
core-ci voted on patch set 12 V +1 10/05/23, 09:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47429
-
Stefan Bürk voted on patch set 12 V +1 CR +1 10/05/23, 12:26
-
Oliver Klee wrote 10/05/23, 15:13
Removed reviewer Oliver Klee. -
Oli Bartsch voted on patch set 12 V +1 CR +1 10/06/23, 13:55
-
Oli Bartsch uploaded patch set 13
CR +1V +110/06/23, 14:05 -
Oli Bartsch voted on patch set 13 V +1 CR +1 10/06/23, 14:05
-
core-ci voted on patch set 13 V +1 10/06/23, 14:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47499
-
Jörg Bösche voted on patch set 13 CR +1 10/27/23, 07:18
-
Simon Schaufelberger uploaded patch set 14
CR +1V +104/21/24, 21:17 -
Simon Schaufelberger commented on patch set 14 04/21/24, 21:18
This one was laying around for so long with a lot of votes that it became not mergeable again. I hope it will make it this time ;) -
core-ci voted on patch set 14 V -1 04/21/24, 21:22 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56445
-
Simon Schaufelberger uploaded patch set 15
V -104/21/24, 21:30 -
core-ci voted on patch set 15 V +1 04/21/24, 21:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56446
-
Chris Müller uploaded patch set 16
V +105/02/24, 17:47 -
core-ci voted on patch set 16 V +1 05/02/24, 17:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57108
-
Andreas Kienast commented on patch set 16 06/04/24, 07:22
What might be a suitable use-case for the event? Additional hints: I get it, but that should IMO become patches. What kind of Fluid changes might be necessary here? -
Guido Schmechel commented on patch set 16 07/11/24, 17:54
Reply
I don't know if I've understood it completely, but I'll give it a try: The original idea was to be able to integrate external documentation into the TYPO3 search. I would also like to be able to add the notes independently as a developer. That's why it was once planned to implement this here: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80536 -
Guido Schmechel rebased onto patch set 17
V +101/19/25, 16:13 -
Guido Schmechel uploaded patch set 18 01/19/25, 16:16
-
core-ci voted on patch set 17 V -1 01/19/25, 16:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72685
-
core-ci voted on patch set 18 V -1 01/19/25, 16:22 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72686
-
Oli Bartsch uploaded patch set 19
V -101/20/25, 09:57 -
core-ci voted on patch set 19 V +1 01/20/25, 10:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72716
-
Oli Bartsch voted on patch set 19 CR +1 V +1 01/20/25, 10:07
-
Josef Glatz updated the commit message in patch set 20
CR +1V +102/24/25, 18:44 -
core-ci voted on patch set 20 V +1 02/24/25, 18:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74634
-
Oli Bartsch voted on patch set 20 CR +1 V +1 02/25/25, 08:45
-
Andreas Kienast voted on patch set 20 CR +1 V +1 02/28/25, 11:37
-
Christian Kuhn commented on patch set 20 CR -1 03/02/25, 01:33
@bo@cedev.de or @a.herzog@kienastdv.de could you have a look to get details right?LiveSearchController.php:86this usage of named arguments violates our rules.ModifyLiveSearchFormDataEvent.php:37why are there 3 arguments when the event is created with only 2? -
Andreas Kienast commented on patch set 20 03/02/25, 10:00
LiveSearchController.php:86ReplyThanks, I didn't spot this.ModifyLiveSearchFormDataEvent.php:37ReplyAcknowledged -
Andreas Kienast uploaded patch set 21
CR +1V +103/02/25, 10:00 -
Andreas Kienast commented on patch set 21 03/02/25, 10:01
LiveSearchController.php:86ReplyDone -
core-ci voted on patch set 21 V -1 03/02/25, 10:06 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74962
-
Andreas Kienast uploaded patch set 22
V -103/02/25, 10:51 -
core-ci voted on patch set 22 V +1 03/02/25, 10:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74965
-
Jörg Bösche voted on patch set 22 CR +1 03/24/25, 09:04
-
Andreas Kienast voted on patch set 22 CR +1 V +1 03/26/25, 12:47
-
Benni Mack commented on patch set 22 CR -1 03/26/25, 17:07
I don't want to picky here, but an Event should be named as it is - when it occurs - and not what you can do with it. I tried my best to keep this line for 95% of the introduced Events, so please rename this Event to "AfterWhateverWasDoneWithThatDateInCoreLiveSearchEvent" - people might not want to "Modify" something, but rather be a subscriber to the event to trigger stats how often people used the live search. -
Andreas Kienast uploaded patch set 23
CR +1V +103/27/25, 15:29 -
Andreas Kienast commented on patch set 23 03/27/25, 15:33
Reply
Done -
core-ci voted on patch set 23 V +1 03/27/25, 15:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76475
-
Andreas Kienast voted on patch set 23 CR +1 V +1 03/27/25, 15:48
-
Georg Ringer voted on patch set 23 CR +2 V +2 03/27/25, 15:58
-
Georg Ringer merged patch set 24 03/27/25, 15:58
-
Lina Wolf commented on patch set 24 03/29/25, 06:41
Please review according docs: https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-CoreApi/pull/5474