92579[BUGFIX] Enhance message handler registration to support multiple types
Commit message
Review
-
Code review CR +2 Done
- Garvin Hicking +2
- Moritz Ngo +1
- Sascha Nowak +1
-
Verified V +2 Done
- Garvin Hicking +2
- Moritz Ngo +1
- Sascha Nowak +1
- core-ci +1 CI
Issues 1
Files 17
- typo3/sysext/core/Classes/DependencyInjection/ListenerProviderPass.php2+3 −9
- typo3/sysext/core/Classes/DependencyInjection/MessageHandlerPass.php2+51 −34
- typo3/sysext/core/Tests/Functional/DependencyInjection/AsMessageHandlerAttributeTest.phpnew+63 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_message_handler/Classes/Message/Captains.phpnew+25 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_message_handler/Classes/Message/ClassMethodAttributeMessageHandler.phpnew+29 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_message_handler/Classes/Message/ClassMethodMessageHandler.phpnew+29 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_message_handler/Classes/Message/MorePrincessesMessageHandler.phpnew+29 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_message_handler/Classes/Message/MultipleMessagesHandler.phpnew+29 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_message_handler/Classes/Message/MultipleMessagesMethodAttributeHandler.phpnew+29 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_message_handler/Classes/Message/MultipleMethodsAsAttributeHandler.phpnew+35 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_message_handler/Classes/Message/MultipleMethodsHandler.phpnew+35 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_message_handler/Classes/Message/Princesses.phpnew+25 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_message_handler/Classes/Message/PrincessesMessageHandler.phpnew+29 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_message_handler/Configuration/Services.yamlnew+8 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_message_handler/composer.jsonnew+19 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_message_handler/ext_emconf.phpnew+21 −0
- composer.json+1 −0
Review log 1925
-
Sascha Nowak uploaded patch set 1 01/29/26, 20:15
-
Sascha Nowak commented on patch set 1 01/29/26, 20:22
If anyone likes to test it, here are the classes I used to test the compiler https://gist.github.com/saschanowak/598956c78e1ae2165f2f74074284860c -
Sascha Nowak uploaded patch set 2 01/29/26, 20:31
-
Garvin Hicking commented on patch set 1 01/29/26, 20:35
Looks promising, we should add a fixture extension plus functional test for it.MessageHandlerPass.php:78Let's try to avoid empty in favor of !==[] && != null && != '' for more strictness, even though it's more code, the empty() magic is problematic -
core-ci voted on patch set 2 V +1 01/29/26, 20:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94599
-
Sascha Nowak uploaded patch set 3
V +101/29/26, 20:50 -
Sascha Nowak commented on patch set 2 01/29/26, 20:51
Reply
This would be great, but THB I have no idea how to test the output of the symfony DI cache fileMessageHandlerPass.php:78ReplyDone -
core-ci voted on patch set 1 V -1 01/29/26, 20:51 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94598
-
core-ci voted on patch set 3 V +1 01/29/26, 21:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94601
-
Garvin Hicking commented on patch set 3 01/29/26, 21:50
Reply
I was more thinking of putting real message handler registrations in the fixture and let them each operate on a message in one functional test, and in the end check if the mesagee has all the variations applied that each handler would add? -
Moritz Ngo commented on patch set 3 CR +1 V +1 01/30/26, 03:28
awesome, I've added the patch and tested the changes in my project with that specific use case and it works like charm -
Moritz Ngo commented on patch set 3 01/30/26, 03:32
ListenerProviderPass.php:78I was wondering why you're now checking the types explicitly, using `empty` should do the same thing, or am I missing something? -
Garvin Hicking commented on patch set 3 01/30/26, 05:45
ListenerProviderPass.php:78ReplyYes, we try to avoid using empty() - see my comment earlier here. -
Garvin Hicking uploaded patch set 4
CR +1V +101/30/26, 20:55 -
core-ci voted on patch set 4 V -1 01/30/26, 21:05 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94710
-
Garvin Hicking uploaded patch set 5
V -101/30/26, 21:22 -
core-ci voted on patch set 5 V +1 01/30/26, 21:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94711
-
Garvin Hicking commented on patch set 6
V +101/30/26, 21:35Published edit on patch set 5. -
Garvin Hicking commented on patch set 6 CR +1 V +1 01/30/26, 21:37
Reply
Please check out my test proposal, even though it looks much it's rather light weight and just "proves" that your adaptations work great (for me and the cases you provided) 😊 -
core-ci voted on patch set 6 V +1 01/30/26, 21:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94712
-
Moritz Ngo commented on patch set 6 CR +1 V +1 02/02/26, 15:32
Reply
Yeah, that looks quite complicated at first glance, but it's well thought out and looks good to me 😊 -
Sascha Nowak voted on patch set 6 CR +1 V +1 02/03/26, 13:29
-
Sascha Nowak commented on patch set 6 02/03/26, 13:31
Reply
Done -
Garvin Hicking voted on patch set 6 CR +2 V +2 02/03/26, 13:32
-
Garvin Hicking merged patch set 7 02/03/26, 16:07