Review main Merged

77626[FEATURE] Introduce associative array keys for TCA items

Nikita Hovratov CR +2 V +2 Nightmare +3207 −2130 updated 03/21/23, 08:47

Commit message

The TCA types select, radio and check now have associative array keys
for their items array.

The mapping is as following:

0 => 'label' (select, radio, check)
1 => 'value' (select, radio)
2 => 'icon' (select)
3 => 'group' (select)
4 => 'description' (select; renderType=selectCheckBox)

This change eases the introduction of new functionality to the items
array in the future and provides a vastly improved code readability.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Georg Ringer +1
    • Jochen Roth +1
    • Markus Klein +1
    • Stefan Bürk +1
    • Christian Kuhn +1
  • Verified V +2 Done
    • Benni Mack +2
    • Georg Ringer +1
    • Jochen Roth +1
    • Markus Klein +1
    • Stefan Bürk +1
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 1

Files 139

Show 119 more files

Review log 4360

Show 2235 earlier messages
  1. Nikita Hovratov uploaded patch set 1 01/28/23, 18:48

  2. core-ci voted on patch set 1 V -1 01/28/23, 18:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36715

  3. Nikita Hovratov uploaded patch set 2 V -1 01/28/23, 21:00

  4. core-ci voted on patch set 2 V -1 01/28/23, 21:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36716

  5. Nikita Hovratov uploaded patch set 3 V -1 01/28/23, 21:20

  6. core-ci voted on patch set 3 V -1 01/28/23, 21:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36717

  7. Nikita Hovratov uploaded patch set 4 V -1 01/28/23, 23:35

  8. core-ci voted on patch set 4 V -1 01/28/23, 23:41 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36722

  9. Nikita Hovratov commented on patch set 4 01/28/23, 23:45

    A bridge patch for styleguide is needed to properly run AC tests: https://github.com/TYPO3/styleguide/pull/375/files
  10. Nikita Hovratov rebased onto patch set 5 V -1 01/30/23, 12:44

  11. core-ci voted on patch set 5 V -1 01/30/23, 12:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36761

  12. Oli Bartsch commented on patch set 5 01/31/23, 08:10

    Great to tackle this topic. What do you think about using a (DTO) object instead of just "another" array structure?
  13. Georg Ringer commented on patch set 5 01/31/23, 08:36

    without checking. does this all work with e.g. itemprocfuncs providing dynamic data?
  14. Benni Mack commented on patch set 5 01/31/23, 08:40

    TreeController.php:219

    how to handle that in the future? Seems like a breaking change for extensions relying on itemsProcFuncs etc.
  15. Benni Mack commented on patch set 5 01/31/23, 08:42

    Maybe it would be good to have a SelectItem DTO just as Oliver proposed, this could implement an \ArrayAccess or \Iterable and also allow for return '0', '1' as before, this way, we would achieve more BC/compat. Also, FormEngine would need to deal with both (array and "SelectItem") as response from an itemsProcFunc in order to allow extensions with the old syntax as well.
  16. Nikita Hovratov commented on patch set 5 01/31/23, 08:54

    Reply

    itemsProcFunc receives the old indexed variant, so custom implementations won't break. The response is converted back to associated array keys. My plan was to introduce a breaking change in v13 for that.

    Reply

    Hey, I also though about a \ArrayAccess kind of thing. Not sure how to implement it though. Would much appreciate a helping hand here, if we really want this. We could also make this a followup patch, as this would only be used internally, right?
  17. Nikita Hovratov rebased onto patch set 6 V -1 02/03/23, 10:26

  18. core-ci voted on patch set 6 V -1 02/03/23, 10:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36971

  19. Nikita Hovratov uploaded patch set 7 V -1 02/03/23, 11:02

  20. core-ci voted on patch set 7 V -1 02/03/23, 11:26 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36975

  21. Nikita Hovratov uploaded patch set 8 V -1 02/03/23, 11:32

  22. Nikita Hovratov uploaded patch set 9 02/03/23, 11:35

  23. core-ci voted on patch set 9 V -1 02/03/23, 12:17 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36982

  24. Nikita Hovratov uploaded patch set 10 V -1 02/03/23, 12:29

  25. core-ci voted on patch set 10 V -1 02/03/23, 12:44 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36983

  26. Nikita Hovratov uploaded patch set 11 V -1 02/03/23, 13:51

  27. core-ci voted on patch set 11 V +1 02/03/23, 14:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36988

  28. Nikita Hovratov commented on patch set 11 02/03/23, 14:11

    finally green 😄
  29. Chris Müller uploaded patch set 12 V +1 02/08/23, 17:47

  30. core-ci voted on patch set 12 V +1 02/08/23, 18:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37397

  31. Nikita Hovratov uploaded patch set 13 V +1 02/17/23, 23:12

  32. core-ci voted on patch set 13 V -1 02/17/23, 23:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37853

  33. Nikita Hovratov uploaded patch set 14 V -1 02/17/23, 23:38

  34. Nikita Hovratov commented on patch set 14 02/17/23, 23:40

    Reply

    Done

    TreeController.php:219 Reply

    Done
  35. core-ci voted on patch set 14 V +1 02/17/23, 23:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37854

  1. Nikita Hovratov rebased onto patch set 15 V +1 03/02/23, 12:22

  2. core-ci voted on patch set 15 V +1 03/02/23, 12:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38298

  3. Nikita Hovratov uploaded patch set 16 V +1 03/02/23, 13:20

  4. core-ci voted on patch set 16 V +1 03/02/23, 13:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38301

  5. Nikita Hovratov rebased onto patch set 17 V +1 03/08/23, 15:26

  6. core-ci voted on patch set 17 V +1 03/08/23, 15:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38659

  7. Georg Ringer voted on patch set 17 V +1 CR +1 03/10/23, 20:28

  8. Markus Klein commented on patch set 17 03/10/23, 21:19

    TcaMigration.php:1393

    should this maybe be called `migrateItemsToAssociativeArray`?

    SelectItem.php:23

    readonly, or even const?

    Feature-99739-AssociatedArrayKeysForTCAItems.rst:6

    Shouldn't this be "associative"?

    Feature-99739-AssociatedArrayKeysForTCAItems.rst:96

    associative
  9. Nikita Hovratov uploaded patch set 18 CR +1 V +1 03/10/23, 22:31

  10. Nikita Hovratov commented on patch set 18 03/10/23, 22:32

    Thanks for the review!

    TcaMigration.php:1393 Reply

    Done

    SelectItem.php:23 Reply

    Done

    Feature-99739-AssociatedArrayKeysForTCAItems.rst:6 Reply

    Done

    Feature-99739-AssociatedArrayKeysForTCAItems.rst:96 Reply

    Done
  11. core-ci voted on patch set 18 V +1 03/10/23, 22:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38782

  12. Markus Klein voted on patch set 18 CR +1 03/11/23, 07:36

  13. Jochen Roth voted on patch set 18 V +1 CR +1 03/16/23, 14:56

  14. Nikita Hovratov commented on patch set 18 03/18/23, 15:39

    bump
  15. Georg Ringer voted on patch set 18 V +1 CR +1 03/19/23, 15:44

  16. Christian Kuhn commented on patch set 18 V +1 CR +1 03/20/23, 15:25

    Talked with Nikita about this one a while ago already: It's apparent this improves the nasty item-array in TCA a lot and it's of course the way to go. I assume everyone agrees on that. This patch however has quite some impact: Many extensions will need adaption to not trigger lots of deprecation messages. Migration is in place, however. The only drawback is that with v12 development, we're already rather late at the party with this patch. The patch itself looks fine to me, but we have a decent risk that we missed some core places that have not been adapted, yet. Chances are, we'll find some more places in the next weeks. I'll vote this up now. I think Benni should take the final decision on this.
  17. Stefan Bürk voted on patch set 18 V +1 CR +1 03/20/23, 15:27

  18. Nikita Hovratov commented on patch set 18 03/20/23, 15:40

    Reply

    Thanks for your clarifying comment lolli! > Many extensions will need adaption to not trigger lots of deprecation messages I think rector will fix them easily > but we have a decent risk that we missed some core places that have not been adapted, yet. Yes, eventhough I searched very thouroughly for every occurrence, there might still be a place I missed. But we have the stabilization phase for that. > we're already rather late at the party with this patch Yep, it's one of these "last minute features". But it completes the set of TCA improvements in v12.
  19. Markus Klein commented on patch set 18 03/20/23, 17:14

    Reply

    > I think rector will fix them easily Sure but you need to consider extensions supporting v11 and v12. I see the main issue in this field.
  20. Markus Klein commented on patch set 18 V +1 03/20/23, 17:15

    Reply

    You probably have to go with a version switch then, I think.
  21. Nikita Hovratov commented on patch set 18 03/20/23, 17:40

    Reply

    Sure, but this is true for every TCA change :) Yes, either version switch or a new version, which only supports v12 + upcoming v13. In the end, it's only a deprecation and those logs can and should be disabled in production.
  22. Benni Mack commented on patch set 18 CR -2 03/20/23, 21:51

    Just tested this with non-migrated flexforms (this might become an issue). Looks good but I'm a bit skeptical of merging it so late before Feature Freeze. I'll have a good nights sleep and also want to test it in a latest v12.x-dev installation. If everything goes fine, I'll merge it tomorrow. In any case: Great work, Nikita!
  23. Nikita Hovratov commented on patch set 18 03/21/23, 08:44

    Reply

    Thanks for testing, Benni! This pre-patch was very important for flexform: https://review.typo3.org/c/Packages/TYPO3.CMS/+/77643
  24. Benni Mack voted on patch set 18 V +2 CR +2 03/21/23, 08:47

  25. Benni Mack merged patch set 19 03/21/23, 08:47