Review main Merged

90403[FEATURE] Add type-specific TCAdefaults support

Oli Bartsch CR +2 V +2 Expert +1519 −11 updated 08/29/25, 08:50

Commit message

Extend TCAdefaults configuration to support type-specific
syntax similar to TCEFORM, enabling configuration like:

TCAdefaults.tt_content.header_layout.types.textmedia = 3

This allows different default values based on record
types, making TCAdefaults consistent with TCEFORM patterns.

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

Review log 1923

  1. Oli Bartsch uploaded patch set 1 08/14/25, 21:30

  2. Oli Bartsch updated the commit message in patch set 2 08/14/25, 21:30

  3. Oli Bartsch uploaded patch set 3 08/14/25, 21:32

  4. 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

  5. Oli Bartsch commented on patch set 3 08/14/25, 21:41

    DatabaseRowInitializeNew.php:299

    If we would change the order, so that setDefaultsFromDefaultValues() is called before `setDefaultsFromUserTsConfig()` and `setDefaultsFromPageTsConfig`, the record type would have been evaluated already and we could remove this method. However, I fear changing this order will lead to a lot of side effects.
  6. Oli Bartsch uploaded patch set 4 V +1 08/15/25, 09:42

  7. 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

  8. Oli Bartsch uploaded patch set 5 V -1 08/15/25, 10:02

  9. 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

  10. Stefan Bürk commented on patch set 5 CR +1 V +1 08/18/25, 07:16

    DatabaseRowInitializeNew.php:299 Reply

    Changing 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 ?
  11. Oli Bartsch commented on patch set 5 08/18/25, 07:25

    DatabaseRowInitializeNew.php:299 Reply

    Yes 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.
  12. 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.
  13. 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.
  14. 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.
  15. Stefan Froemken commented on patch set 5 08/22/25, 08:11

    DatabaseRowInitializeNew.php:312

    I 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.
  16. Oli Bartsch uploaded patch set 6 CR +1 V +1 08/28/25, 07:21

  17. Oli Bartsch commented on patch set 6 08/28/25, 07:21

    DatabaseRowInitializeNew.php:312 Reply

    Done
  18. 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

  19. Stefan Froemken commented on patch set 6 08/29/25, 07:36

  20. 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.
  21. Stefan Bürk voted on patch set 6 CR +1 V +1 08/29/25, 08:46

  22. Oli Bartsch voted on patch set 6 CR +2 V +2 08/29/25, 08:50

  23. Oli Bartsch merged patch set 7 08/29/25, 08:50