90403[FEATURE] Add type-specific TCAdefaults support
Commit message
Review
-
Code review CR +2 Done
- Oli Bartsch +2
- Stefan Bürk +1
- Stefan Froemken +1
-
Verified V +2 Done
- Oli Bartsch +2
- Stefan Bürk +1
- Stefan Froemken +1
- core-ci +1 CI
Issues 1
Files 7
- typo3/sysext/backend/Classes/Form/FormDataProvider/DatabaseRowInitializeNew.php5+116 −2
- typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseRowInitializeNewTest.php+613 −0
- typo3/sysext/core/Classes/DataHandling/DataHandler.php+97 −9
- typo3/sysext/core/Documentation/Changelog/14.0/Feature-107281-TypeSpecificTCAdefaults.rstnew+129 −0
- typo3/sysext/core/Tests/Functional/DataHandling/DataHandler/DefaultValuesTest.php+188 −0
- typo3/sysext/core/Tests/Functional/DataHandling/TypeSpecificTcaDefaultsIntegrationTest.phpnew+374 −0
- typo3/sysext/core/Tests/Functional/Fixtures/be_users_admin.csv+2 −0
Review log 1923
-
Oli Bartsch uploaded patch set 1 08/14/25, 21:30
-
Oli Bartsch updated the commit message in patch set 2 08/14/25, 21:30
-
Oli Bartsch uploaded patch set 3 08/14/25, 21:32
-
core-ci voted on patch set 3 V +1 08/14/25, 21:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83413
-
Oli Bartsch commented on patch set 3 08/14/25, 21:41
-
Oli Bartsch uploaded patch set 4
V +108/15/25, 09:42 -
core-ci voted on patch set 4 V -1 08/15/25, 09:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83444
-
Oli Bartsch uploaded patch set 5
V -108/15/25, 10:02 -
core-ci voted on patch set 5 V +1 08/15/25, 10:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83446
-
Stefan Bürk commented on patch set 5 CR +1 V +1 08/18/25, 07:16
DatabaseRowInitializeNew.php:299ReplyChanging the the order would remove the ability to override existing TCA default value with UserTSConfig/PageTsConfig and would promote TCA default to higher precedence. I don't think that is what we want. What do you think ? -
Oli Bartsch commented on patch set 5 08/18/25, 07:25
DatabaseRowInitializeNew.php:299ReplyYes we should avoid changing anything in this chain. Just wanted to point out. I anyways think that this method is more solid on finding the record type. -
Daniel Windloff commented on patch set 5 08/19/25, 09:46
I suggest creating a prepatch to clarify the internal state of the default values in DataHandler and resolve current bugs before adding this nice feature. The result should be that no usr or page ts config related default values are stored in the property $default Values anymore. At the moment the calculated values set by default values, user and tsconfig are stored in a property, which leads to bugs when processing different pids with different default values in tsconfig. If you like, I can create such a prepath at the end of the week. -
Oli Bartsch commented on patch set 5 08/19/25, 10:23
Reply
I don’t really see how this is blocking the current patch. Are there any known or reported bugs related to default values? That said, I agree it makes sense to streamline this, and I understand your point regarding the class property. Please feel free to create a pre-patch for that. I’ll check back on this next week. I’d just prefer not to delay this patch by waiting on the other one. -
Daniel Windloff commented on patch set 5 08/21/25, 06:55
Reply
Sry, it is not my intention to block anything here. My feeling is only, that more state in DH would make refactoring harder. As far as I know, there is #101435 as issue related to the missing type overwrite in DH. The issue regarding the (possible false) state in defaultValues on different pids does not have an issue yet as far as I know. -
Stefan Froemken commented on patch set 5 08/22/25, 08:11
DatabaseRowInitializeNew.php:312I have a problem with all these "empty" calls. There is no data-type check. In theory "type" can also be an array or int and that will throw an error, if first argument of str_contains is not a string. -
Oli Bartsch uploaded patch set 6
CR +1V +108/28/25, 07:21 -
Oli Bartsch commented on patch set 6 08/28/25, 07:21
DatabaseRowInitializeNew.php:312ReplyDone -
core-ci voted on patch set 6 V +1 08/28/25, 07:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83931
-
Stefan Froemken commented on patch set 6 08/29/25, 07:36
What about this part? Should that be respected, too? https://github.com/TYPO3/typo3/blob/main/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaColumnsOverrides.php#L45-L46 -
Stefan Froemken commented on patch set 6 CR +1 V +1 08/29/25, 07:42
Tested with pageTSconfig, userTSconfig, checked if it still works with columnsOverrides. TCAdefaults also works for page records dragged/dropped into the page-tree.Reply
No, it must not. It's an "!isset". My fault. -
Stefan Bürk voted on patch set 6 CR +1 V +1 08/29/25, 08:46
-
Oli Bartsch voted on patch set 6 CR +2 V +2 08/29/25, 08:50
-
Oli Bartsch merged patch set 7 08/29/25, 08:50
DatabaseRowInitializeNew.php:299