Review main Merged

69906[TASK] Remove default values in TCA of core fields

Nikita Hovratov CR +2 V +2 Easy +0 −48 updated 11/04/21, 11:29

Commit message

This removes the default values for:

- minitems = 0 in general
- size = 1 with renderType = selectSingle

minitems = 0 can be safely removed, as it is always the default.
size = 1 adds the html size attribute size="1". This is the default
anyway and only used in FormEngine.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Oli Bartsch +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Oli Bartsch +1
    • core-ci +1 CI

Issues 1

Files 24

Show 4 more files

Review log 1623

  1. Nikita Hovratov uploaded patch set 1 07/17/21, 09:42

  2. core-ci voted on patch set 1 V -1 07/17/21, 09:57 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13412

  3. Nikita Hovratov uploaded patch set 2 07/17/21, 10:02

  4. core-ci voted on patch set 2 V +1 07/17/21, 10:17 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13414

  5. Oli Bartsch commented on patch set 2 V -1 07/17/21, 11:25

    Hi, please keep in mind, TCA options are not only used for the visual appearance, but also for validation, e.g. in DataHandler (see "checkValue_checkMax()" for example). There are multiple ways to create / update records besides FormEngine (e.g. CLI or /record/commit). Therefore, this settings must IMO stay. Also, as you already noted in your commit message, the validation string is now wrong. We had so many bugs in FormEngine validation recently, I don't think this would be a good idea to render "wrong" settings for now. Also the "size" attribute may not be required. However, I like to have those settings set explicit. At least the SelectSingleElement should then be adjusted accordingly. Removing "minitems=0" should - without particularly examination - be ok.
  6. Nikita Hovratov commented on patch set 2 07/18/21, 09:32

    Reply

    The TCA reference states, maxitems is ignored for selectSingle: https://docs.typo3.org/m/typo3/reference-tca/master/en-us/ColumnsConfig/CommonProperties/Maxitems.html?highlight=maxitems#confval-maxitems. This is apparently not true. About size: Do you mean you like it better to have size=1 in html than nothing at all eventhough it is the same? Also here the TCA reference says 1 is the default. This is also wrong, as it defaults to "0" which means it will not be rendered. IMO having selectSingle should automatically mean size=1, minitems=0, maxitems=1 without explicitly defining it. Maybe we could tackle this first so then this patch would be valid? What do you think?
  7. Oli Bartsch commented on patch set 2 07/19/21, 10:41

    Reply

    True, however I think docs are just talking about FormEngine, since maxitems is obviously not ignored by DataHanlder. Regarding the "size", you are right. It doesn't make any difference as it only affects FormEngine. So this should also be fine.
  8. Nikita Hovratov uploaded patch set 3 08/01/21, 11:50

  9. Nikita Hovratov commented on patch set 3 08/01/21, 11:53

    Reply

    Okay, I readded the maxitems = 1. But maybe the documentation should hint, that it is only the default for the FormEngine. I think most people don't add this to their custom TCA fields.
  10. core-ci voted on patch set 3 V +1 08/01/21, 12:06 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/13961

  11. Nikita Hovratov uploaded patch set 4 08/03/21, 07:54

  12. core-ci voted on patch set 4 V +1 08/03/21, 08:16 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/14037

  13. Wouter Wolters voted on patch set 4 CR +1 08/03/21, 19:54

  14. Nikita Hovratov rebased onto patch set 5 08/16/21, 17:27

  15. core-ci voted on patch set 5 V +1 08/16/21, 18:01 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15201

  16. Nikita Hovratov uploaded patch set 6 09/30/21, 19:09

  17. core-ci voted on patch set 6 V +1 09/30/21, 19:25 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17365

  18. Anja Leichsenring rebased onto patch set 7 11/04/21, 07:26

  19. core-ci voted on patch set 7 V +1 11/04/21, 07:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18849

  20. Oli Bartsch voted on patch set 7 V +1 CR +1 11/04/21, 10:59

  21. Christian Kuhn voted on patch set 7 V +1 CR +1 11/04/21, 11:28

  22. Christian Kuhn voted on patch set 7 V +2 CR +2 11/04/21, 11:29

  23. Christian Kuhn merged patch set 8 11/04/21, 11:29