83646[WIP][BUGFIX] Evaluate TCEFORM TSconfig for flexform overrides
Commit message
Review
-
Code review CR 0
-
Verified V 0
Issues 4
- Bug #103532Using TSconfig TCEFORM to change existing flexform field configuration does not work
- Bug #102595Not possible to override richtextConfiguration via TSconfig if in a flexform
- Feature #36609Overwriting flexform in page TSConfig is not respected in TCEMain
- Feature #91690Override Flexform via Page TsConfig
Files 3
Review log 2434
Show 59 earlier messages
-
Garvin Hicking uploaded patch set 1 04/04/24, 11:23
-
core-ci voted on patch set 1 V -1 04/04/24, 11:28 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55330
-
Garvin Hicking uploaded patch set 2
V -104/04/24, 11:31cgl -
core-ci voted on patch set 2 V +1 04/04/24, 11:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55331
-
Garvin Hicking uploaded patch set 3
V +104/04/24, 12:22adjust multiline comments -
core-ci voted on patch set 3 V -1 04/04/24, 12:26 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55334
-
Garvin Hicking uploaded patch set 4
V -104/04/24, 12:46cgl part deux -
core-ci voted on patch set 4 V +1 04/04/24, 12:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55335
-
Oli Bartsch commented on patch set 4 04/04/24, 13:41
This patch reads quite good! However, please let's cover this with tests.
-
Garvin Hicking commented on patch set 4 04/04/24, 14:33
Reply
If it has a chance of implementation I'll happily try to! Could you give me a hint on how to test this? Do I need to fake an event listener to check the data? I'm a bit clueless about the implications, but if there's something similar I can use as a template...? -
Garvin Hicking uploaded patch set 5
V +104/04/24, 16:55Add test -
Garvin Hicking uploaded patch set 6 04/04/24, 16:56
cgl -
Garvin Hicking commented on patch set 6 04/04/24, 16:59
Reply
I've added a simple test `overrideFieldConfWorksFromTSConfigOverrideOnFlexform` to the existing `FlexFormToolsTest`, which operates on a simple datastructure, parses that to TCA, adds TSConfig to override that, and verifies the expected TCA matches the operation. Please let me know if there is anything else I can test. It would be a lot of permutations to test every possible TCA key and it's allowOverrideMatrix correspondance - so I hope one representative key should do. -
core-ci voted on patch set 6 V +1 04/04/24, 17:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55342
-
core-ci voted on patch set 5 V -1 04/04/24, 17:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55341
-
Nikita Hovratov commented on patch set 6 04/04/24, 18:11
Please add a new "Related" entry for each issue, rather than comma separated. -
Nikita Hovratov commented on patch set 6 04/04/24, 18:17
FlexFormTools.php:739Not sure if this is the right place for the method. Lolli worked hard to reduce this service class to the few methods, which are left. A static method seems out of place here. Let's either put it inside FormEngineUtility (the only place where this is used) or create a new internal utility class. -
Garvin Hicking commented on patch set 6 04/04/24, 19:18
FlexFormTools.php:739ReplyI was afraid that exactly @lolli@schwarzbu.ch refactoring flexformtools more would maybe miss such a utility class then. His future refactoring might then move this to a better fit place/structure? Introducing another flexform utility feels wrong to me, better to have flexform operations at a single place. It's quite easy to move anywhere, so I'd be quite happy for instructions, maybe I can summon Lolli on this for ideas: lollijuice, lollyjuice, lollyjuice? -
Garvin Hicking uploaded patch set 7
V +104/05/24, 07:27Improved tests and fixed one depth level -
Garvin Hicking uploaded patch set 8 04/05/24, 07:28
cgl -
Garvin Hicking commented on patch set 8 04/05/24, 07:31
Reply
I've added some more tests operating on invalid TSconfig and TCA, and actually with that found out I had one level of "[default]" too much in the TSconfig array. Well worth the tests, sorry for not adding it directly. :-)Reply
Done -
core-ci voted on patch set 7 V -1 04/05/24, 07:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55370
-
core-ci voted on patch set 8 V +1 04/05/24, 07:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55371
-
Garvin Hicking uploaded patch set 9
V +104/05/24, 08:21Default datastructureIdentifier was actually needed -
core-ci voted on patch set 9 V +1 04/05/24, 08:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55372
-
Garvin Hicking commented on patch set 9 04/05/24, 08:27
Reply
Actually that "default" was needed due to it being the dataStructureKey that needs to match. I found my mistake on this and now it's (hopefully) properly checked in the execution and tests. -
Christian Kuhn commented on patch set 9 04/09/24, 11:29
FlexFormTools.php:739Replyfirst reply: currently unsure. but i especially dislike the introduced dependency from core to backend through FormEngineUtility::getAllowOverrideMatrix();FlexFormTools.php:783this, together with json_decode($fieldConfig['dataStructureIdentifier']) is an api misuse: the ds-identifier is an internal structure that is only understood and should only be parsed by the above methods, see their comments. actually formEngine should have the resolved DS at this point, if not, the call to the overrides needs to be relocated in formEngine somehow. needs more investigation. -
Christian Kuhn commented on patch set 9 CR -1 04/09/24, 11:30
-1 for now, needs a bit of investigation. -
Garvin Hicking commented on patch set 9 04/09/24, 11:58
FlexFormTools.php:739Reply UnresolvedWe could transport the whole override matrix as a parameter to the FlexFormTools::overrideFieldconf. Or, if we decide to not keep the new code in FlexFormTools, but rather move it to FormEngineUtility, we can of course just use the local property then and don't even need to carry it across. I'm totally open on where to move the functionality of this, I have no clear preference.FlexFormTools.php:783ReplyLet me try to explain the reasoning behind this a bit: The large array iteration is performed on the TCEForm array. That TCEform references the "dataStructureKey" (for tt_content that's "pi_flexform" as a name, for the styleguide example and others it's "default"). To properly iterate the TCEform array to find the columns to be overriden from the datastructure, I need that key. The key is contained in the large JSON chunk, and I only need the `dataStructureKey` from it. The whole DS source is irrelevant from what I can see. Since it is already part of what is getting passed as $fieldConfig to FormEngineUtility::overrideFieldConf() in first place. So at this point I don't really care about the contents of the DS, but just the key, for the TCEform lookup. The method `parseDataStructureByIdentifier` (which performs the json_decode) only returns $dataStructure, and that array is missing the datastructureKey; so I sadly cannot utilize that method at all. Instead, we could refactor the "json_decode" call inside that method to be its own method, and let `FlexFormTools::overrideFieldConf` access that method. To do that, no longer could FlexForms be called statically, but would need a full makeInstance call with DI, and the new method wouldn't do more than json_decode() (probably it shouldn't even throw an error, and just not apply modifications from TCEForm to TCA ). So that feels like very much of legwork (and possible performance) just to get the dataStructureKey for further operation, which would be retrievable with that one line of json_decode? Any other type than "tca" for it could be ignored, since this only applies to the TCA-Rendering of FormEngine. Happy to hear your thoughts on this, and I'll provide an implementation if you can map me a way through the goalposts. -
Garvin Hicking commented on patch set 9 04/09/24, 12:25
FormEngineUtility.php:58UnresolvedNote to self after feedback by Christian: Allowing this is problematic. DataHandler will (probably?) not perform data cleanup methods on a field if it is changed as an override instead of a native definition, because DataHandler will not parse TCEForm overrides here (probably?). Test & make sure that this is still the case, or if DataHandler has some secret sauce to perform sanitizing and processing after all. Remove this again and add a code comment about why not every override is allowed (reference to DataHandler). Cleanup references to 'richText' in commit message and tests. -
Stefan Bürk commented on patch set 9 04/10/24, 11:53
FlexFormTools.php:783Reply UnresolvedAlternative change to discuss -> https://review.typo3.org/c/Packages/TYPO3.CMS/+/83728 -
Garvin Hicking updated the commit message in patch set 10
CR -1V +109/18/24, 09:19 -
core-ci voted on patch set 10 V -1 09/18/24, 09:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66111
-
Garvin Hicking abandoned the change 12/29/24, 23:52
Continued in https://review.typo3.org/c/Packages/TYPO3.CMS/+/83728 (hopefully)