75158[!!!][FEATURE] Add PSR-14 Events for flex form parsing
Commit message
Review
-
Code review CR +2 Done
- Oli Bartsch +2
- Benni Mack +1
-
Verified V +2 Done
- Oli Bartsch +2
- Benni Mack +1
- core-ci +1 CI
Issues 1
Files 38
- Build/phpstan/phpstan-baseline.neon+0 −10
- typo3/sysext/backend/Classes/Form/FormDataProvider/TcaFlexPrepare.php+1 −1
- typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaFlexPrepareTest.php+7 −0
- typo3/sysext/backend/Tests/UnitDeprecated/Form/FormDataProvider/TcaFlexPrepareTest.php+7 −0
- typo3/sysext/core/Classes/Configuration/Event/AfterFlexFormDataStructureIdentifierInitializedEvent.phpnew+81 −0
- typo3/sysext/core/Classes/Configuration/Event/AfterFlexFormDataStructureParsedEvent.phpnew+53 −0
- typo3/sysext/core/Classes/Configuration/Event/BeforeFlexFormDataStructureIdentifierInitializedEvent.phpnew+95 −0
- typo3/sysext/core/Classes/Configuration/Event/BeforeFlexFormDataStructureParsedEvent.phpnew+62 −0
- typo3/sysext/core/Classes/Configuration/FlexForm/FlexFormTools.php+174 −213
- typo3/sysext/core/Documentation/Changelog/12.0/Breaking-97449-RemovedHookForModifyingFlexFormParsing.rstnew+41 −0
- typo3/sysext/core/Documentation/Changelog/12.0/Feature-97449-PSR-14EventsForModifyingFlexFormParsing.rstnew+207 −0
- typo3/sysext/core/Tests/Functional/Configuration/FlexForm/FlexFormToolsTest.php4new+1627 −0
- typo3/sysext/core/Tests/Unit/Configuration/FlexForm/Fixtures/DataStructureIdentifierPostProcessHookReturnArray.phpdeleted+0 −45
- typo3/sysext/core/Tests/Unit/Configuration/FlexForm/Fixtures/DataStructureIdentifierPostProcessHookReturnEmptyArray.phpdeleted+0 −44
- typo3/sysext/core/Tests/Unit/Configuration/FlexForm/Fixtures/DataStructureIdentifierPostProcessHookReturnString.phpdeleted+0 −44
- typo3/sysext/core/Tests/Unit/Configuration/FlexForm/Fixtures/DataStructureIdentifierPostProcessHookThrowException.phpdeleted+0 −45
- typo3/sysext/core/Tests/Unit/Configuration/FlexForm/Fixtures/DataStructureIdentifierPreProcessHookReturnArray.phpdeleted+0 −45
- typo3/sysext/core/Tests/Unit/Configuration/FlexForm/Fixtures/DataStructureIdentifierPreProcessHookReturnEmptyArray.phpdeleted+0 −42
- typo3/sysext/core/Tests/Unit/Configuration/FlexForm/Fixtures/DataStructureIdentifierPreProcessHookReturnString.phpdeleted+0 −38
- typo3/sysext/core/Tests/Unit/Configuration/FlexForm/Fixtures/DataStructureIdentifierPreProcessHookThrowException.phpdeleted+0 −43
Show 18 more files
- typo3/sysext/core/Tests/Unit/Configuration/FlexForm/Fixtures/DataStructureParsePostProcessHookReturnArray.phpdeleted+0 −39
- typo3/sysext/core/Tests/Unit/Configuration/FlexForm/Fixtures/DataStructureParsePostProcessHookReturnString.phpdeleted+0 −36
- typo3/sysext/core/Tests/Unit/Configuration/FlexForm/Fixtures/DataStructureParsePostProcessHookThrowException.phpdeleted+0 −37
- typo3/sysext/core/Tests/Unit/Configuration/FlexForm/Fixtures/DataStructureParsePreProcessHookReturnEmptyString.phpdeleted+0 −35
- typo3/sysext/core/Tests/Unit/Configuration/FlexForm/Fixtures/DataStructureParsePreProcessHookReturnObject.phpdeleted+0 −35
- typo3/sysext/core/Tests/Unit/Configuration/FlexForm/Fixtures/DataStructureParsePreProcessHookReturnString.phpdeleted+0 −42
- typo3/sysext/core/Tests/Unit/Configuration/FlexForm/Fixtures/DataStructureParsePreProcessHookThrowException.phpdeleted+0 −36
- typo3/sysext/core/Tests/Unit/Configuration/FlexForm/FlexFormToolsTest.php+9 −1677
- typo3/sysext/core/Tests/Unit/DataHandling/DataHandlerTest.php+21 −5
- typo3/sysext/core/Tests/Unit/Fixtures/EventDispatcher/MockEventDispatcher.php2new+38 −0
- typo3/sysext/core/Tests/Unit/Hooks/TcaItemsProcessorFunctionsTest.php+10 −0
- typo3/sysext/form/Classes/EventListener/DataStructureIdentifierListener.phpnew+393 −0
- typo3/sysext/form/Classes/Hooks/DataStructureIdentifierHook.phpdeleted+0 −402
- typo3/sysext/form/Configuration/Services.yaml+9 −0
- typo3/sysext/form/Tests/Unit/Controller/FormFrontendControllerTest.php+17 −3
- typo3/sysext/form/Tests/Unit/EventListener/DataStructureIdentifierListenerTest.phprenamed+52 −29
- typo3/sysext/form/ext_localconf.php+0 −7
- typo3/sysext/install/Configuration/ExtensionScanner/Php/ArrayDimensionMatcher.php+6 −0
Review log 5275
Show 3550 earlier messages
-
crell uploaded patch set 1 07/12/22, 19:34
-
core-ci voted on patch set 1 V -1 07/12/22, 19:44 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29012
-
crell uploaded patch set 2 07/12/22, 20:28
-
core-ci voted on patch set 2 V -1 07/12/22, 20:36 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29015
-
crell uploaded patch set 3 07/13/22, 16:57
-
core-ci voted on patch set 3 V -1 07/13/22, 17:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29078
-
crell uploaded patch set 4 07/13/22, 20:56
-
core-ci voted on patch set 4 V -1 07/13/22, 21:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29101
-
crell uploaded patch set 5 07/13/22, 21:20
-
crell updated the commit message in patch set 6 07/13/22, 21:20
-
crell rebased onto patch set 7 07/13/22, 21:24
-
crell commented on patch set 7 07/13/22, 21:26
This should be in a reviewable state now. I am unclear what's going on with the Deprecations fails, as that's all code I didn't touch. I suspect there's other design refactoring that could be done to the events by someone with more knowledge of how they're typically used, but this is a fairly 1:1 migration. If there's other changes that should be made while we're at it (since this is a convenient time to do so), please advise. -
core-ci voted on patch set 5 V -1 07/13/22, 21:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29102
-
core-ci voted on patch set 7 V -1 07/13/22, 21:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29104
-
core-ci voted on patch set 6 V -1 07/13/22, 21:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29103
-
Benni Mack commented on patch set 7 CR -1 07/14/22, 19:39
The hook in EXT:form should be removed. -
Stefan Bürk rebased onto patch set 8 07/15/22, 00:33
-
Stefan Bürk commented on patch set 8 CR -1 07/15/22, 00:35
Reply
Rebased onto fixed `checkAnnotations` integration test. Re-apply Benni's -1 on it.Re-apply Benni's -1 on it. -
core-ci voted on patch set 8 V -1 07/15/22, 00:40 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29179
-
crell commented on patch set 8 07/19/22, 15:36
Reply
Grepping through ext:form, I see over a dozen references to different `$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']` parameters. I'd really rather do that separately, as this patch is involved enough as is. Or is there some other hook you're talking about? -
crell uploaded patch set 9 07/19/22, 17:23
-
core-ci voted on patch set 9 V +1 07/19/22, 17:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29362
-
Oliver Hader commented on patch set 9 07/19/22, 20:37
FlexParsingGetDataStructureEvent.php:12Personally, I dislike these PhpStan specifics... However, if it turns out to be helpful to others, I'd suggest the following: ``` use TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools ... /** * @phpstan-import-type FlexFormToolsIdentifier from FlexFormTools */ ``` This way, it is clear, that local type actually belongs to `FlexFormTools`. -
Oliver Hader commented on patch set 9 07/19/22, 20:43
FlexParsingGetDataStructureEvent.php:12ReplySome more clarification. Using local types "local" in the very same file is okay. Using pseudo-types in different files and probably™ across packages and ignoring the existence of namespaces, is creating new "future challenges"... -
Oliver Klee commented on patch set 9 07/19/22, 21:07
FlexParsingGetDataStructureEvent.php:12ReplyI agree (both with this point as well as the suggestion). -
crell commented on patch set 9 07/19/22, 21:54
FlexParsingGetDataStructureEvent.php:12ReplyI am torn on it, personally. Additionally, I'm no sure if it's safe to keep at all, because in practice both tests and the existing hook code that I'm converting to events in ext:form use entirely different sets of keys, so PHPStan complains. Just throwing them all into the baseline file seems like a bad solution, but it suggests that the identifier struct is insufficiently defined in the first place for the array shape to make sense at all. So it may be better to drop the explicit shape type and define it informally in the comment instead. I'm not sure what the typical usage pattern is right now, so I'm open to suggestions. The options I see are: 1. Roll it back and just make it an informal doc. 2. Keep it as is, with the more precise name, and add more exceptions to the baseline file. 3. Same as 2, but also update the tests at least to mock the formal structure better. (I've not tried to see how much work this might be.) -
crell uploaded patch set 10 07/19/22, 21:56
-
core-ci voted on patch set 10 V -1 07/19/22, 22:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29368
-
Oliver Hader commented on patch set 10 07/20/22, 09:06
FlexParsingGetDataStructureEvent.php:12Replyor "4. Try harder" - now that we are one the way of enforcing strict types everywhere, it really would be a pity to stop here when things are getting interesting! From a OOP-POV there would be local & extended variant of `Identifier` in `ext:form`. From a JSON-Schema-POV it would be a dynamic property. -
Stefan Bürk commented on patch set 10 07/20/22, 12:51
FlexParsingGetDataStructureEvent.php:12ReplyWhy not introducing a small FlexFormIdentifier class with the 4 properties. And at least use it for the event, as a start. Or flexform tools internal - and avoiding to distribute phpstan "array" identifier type's through the core ? -
crell commented on patch set 10 07/20/22, 14:09
FlexParsingGetDataStructureEvent.php:12ReplyI considered just making the identifier a proper class, and all else equal I would vastly prefer that. However, I don't understand the existing usages well enough to say if that would break things. The only live implementation of the hooks in core, I think, is the one in ext:form that I just finished converting, and it already is checking for a $identifier['ext-form-persistenceIdentifier'] key. The existing docs talk about a uid key as something that... maybe should be used, but shouldn't. (Honestly, it's a bit confusing to me.) I could handle converting the tests, but I don't know what to do about existing implementations like that. If we can figure out an approach that doesn't involve crippling the functionality, I am 100% in favor of switching to an object. Oliver: The Identifier struct/class/whatever is created in FlexFormTools, so we wouldn't be able to have an ext:form specific version of it. We *could* potentially do a double-property class, with explicit settable properties and ArrayAccess for "other stuff". I don't know if I like that, but it's an option. -
Oliver Klee wrote 07/21/22, 10:36
Removed cc Oliver Klee. -
crell uploaded patch set 11 08/05/22, 16:18
-
crell commented on patch set 10 08/05/22, 16:19
FlexParsingGetDataStructureEvent.php:12ReplyChristian Kuhn reports that the structure is too fuzzy and inconsistent to bother trying to formalize, so I backed out the phpstan type and just documented the likely keys. -
core-ci voted on patch set 11 V -1 08/05/22, 18:23 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29833
-
crell uploaded patch set 12 08/05/22, 21:25
-
core-ci voted on patch set 12 V +1 08/05/22, 21:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29865
-
Chris Müller commented on patch set 12 CR -1 08/08/22, 17:26
I would prefer to name the FlexParsing...Event better FlexFormParsing...Event to reflect that they can be used to manipulate flexforms. For previous hooks this was clear as FlexForm was part of the array structure when registering them.Feature-97449-PSR-14EventsForControllingFlexParsing.rst:39As the IconFactory is not used in this example it should be not injected. -
crell uploaded patch set 13 08/09/22, 15:08
-
crell commented on patch set 12 08/09/22, 15:08
Feature-97449-PSR-14EventsForControllingFlexParsing.rst:39ReplyDone -
core-ci voted on patch set 13 V +1 08/09/22, 15:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29976
-
crell uploaded patch set 14 08/16/22, 18:22
-
core-ci voted on patch set 14 V +1 08/16/22, 18:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30209
-
Simon Schaufelberger uploaded patch set 15 08/16/22, 20:08
-
Simon Schaufelberger commented on patch set 15 08/16/22, 20:11
FlexFormToolsTest.php:53To make Stefan a lot less angry, please use mocks as he is trying to get rid of prophecy in the core or talk to him about it. -
core-ci voted on patch set 15 V +1 08/16/22, 20:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30210
-
Simon Schaufelberger commented on patch set 15 08/16/22, 20:16
FlexFormToolsTest.php:53Replylet me rephrase it, he is not angry but to "make him really happy"... -
crell commented on patch set 15 08/17/22, 17:20
FlexFormToolsTest.php:53ReplyI'd normally never use Prophecy myself, either. But this is just splitting up existing tests so that the event can be tested, not adding any new Prophecy usage. Refactoring to remove that is a separate task. -
Stefan Bürk commented on patch set 15 08/24/22, 21:48
FlexFormToolsTest.php:53ReplyFirst - it is not about make me "happy" or "angry". The pure fact is, that prophecy seems to be dead. And it is more a core decision to remove prohecy usage from core and with that the dependency (directly and indirectly at some point then). Beside that this is already a bigger task itself, and this patch has been gone through the one or other round and Larry has bleeded to tackle all that test adjustments on existing prophecies to get tests green I would have mentationed it as a "infor for the future" and would say to take this here. And Larry is known to favoriousing not using prophecy or other mock libraries - which now got backed by the need because of the stand with prophecy. -
Stefan Bürk uploaded patch set 16 08/24/22, 21:49
-
Stefan Bürk commented on patch set 16 08/24/22, 21:49
Rebased because of merge conflict. -
core-ci voted on patch set 16 V +1 08/24/22, 21:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30428
-
Simon Schaufelberger wrote 08/24/22, 22:10
Removed cc Simon Schaufelberger. -
Georg Ringer commented on patch set 16 08/25/22, 06:48
FlexFormParsingGetDataStructureEvent.php:3doc "This file is part of the TYPO3 CMS project." missing -
Georg Ringer voted on patch set 16 CR -1 08/25/22, 06:48
-
Stefan Bürk commented on patch set 16 08/25/22, 08:37
FlexFormParsingGetDataStructureEvent.php:3Replytime to get the file header check/fix back - will finish a patch for that later. => https://review.typo3.org/c/Packages/TYPO3.CMS/+/75549MockEventDispatcher.php:15missing space for lines - time to file header check back -
Stefan Bürk rebased onto patch set 17 08/26/22, 17:20
-
core-ci voted on patch set 17 V -1 08/26/22, 17:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30471
-
Stefan Bürk uploaded patch set 18 08/27/22, 12:55
-
core-ci voted on patch set 18 V +1 08/27/22, 13:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30489
-
Stefan Bürk uploaded patch set 19 08/27/22, 13:12
-
core-ci voted on patch set 19 V +1 08/27/22, 13:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30490
-
crell commented on patch set 19 08/29/22, 14:48
FlexFormParsingGetDataStructureEvent.php:3ReplyDoneMockEventDispatcher.php:15ReplyDone -
Stefan Bürk rebased onto patch set 20 09/06/22, 15:29
-
core-ci voted on patch set 20 V +1 09/06/22, 15:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30653
-
Georg Ringer rebased onto patch set 21 09/06/22, 20:04
-
core-ci voted on patch set 21 V +1 09/06/22, 20:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30684
-
Oli Bartsch uploaded patch set 22 09/08/22, 09:30
-
core-ci voted on patch set 22 V -1 09/08/22, 09:41 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30799
-
Oli Bartsch uploaded patch set 23 09/08/22, 09:48
-
core-ci voted on patch set 23 V +1 09/08/22, 09:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30801
-
Oli Bartsch voted on patch set 23 V +1 CR +1 09/08/22, 10:01
-
Benni Mack voted on patch set 23 V +1 CR +1 09/08/22, 10:18
-
Oli Bartsch voted on patch set 23 V +2 CR +2 09/08/22, 11:48
-
Oli Bartsch merged patch set 24 09/08/22, 11:48