Review main Merged

63889[FEATURE] Add grouping and sorting for TCA select items

Benni Mack CR +2 V +2 Hard +832 −166 updated 04/15/20, 15:44

Commit message

Due to the deprecation of "switchable controller actions", list_type items
can now be grouped in FormEngine - as well as all other "select" fields
defined in TCA.

A new TCA option in TCA type=select is added, called "itemGroups".

In addition, all "items" now have four parts (fourth being optional)
0 => label
1 => value
2 => icon
3 => groupID

where the group belongs to an item group (defined explicitly) or taken
from a --div-- element, which then turns into an optgroup.

In order then to avoid the "itemProcFunc" of tt_content.list_type
which is used to sort items, a "sortOrders" option is added to sort
items (within a group, if grouping is enabled) by label or value.

When registering a new plugin, the groupId can be added as well as an
additional parameter, which falls back to the "default" group.

A new method ExtensionManagementUtility::addTcaSelectItemGroup()
allows to add item groups via API.

When registering extbase Plugins or pibase plugins, it is possible
to add a registered "group ID" to make use of this feature.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Georg Ringer +1
    • Alexander Schnitzler +1
  • Verified V +2 Done
    • Benni Mack +2
    • Georg Ringer +1
    • Alexander Schnitzler +1
    • TYPO3com +1 CI

Issues 2

Files 13

Review log 2540

Show 815 earlier messages
  1. Benni Mack uploaded patch set 1 03/24/20, 11:31

  2. TYPO3com voted on patch set 1 V +1 03/24/20, 11:47 Completed build in 14m 52s on Tue, 24 Mar, 11:47 AM Test Summary: 73014 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1663

  3. Georg Ringer commented on patch set 1 03/24/20, 19:10

    currently not working out for me, it always brings an empty optgroup for me

    ExtensionUtility.php:155 Unresolved

    what about setting 'default' as default?
  4. Benni Mack uploaded patch set 2 04/12/20, 19:10

  5. Benni Mack uploaded patch set 3 04/12/20, 19:21

  6. TYPO3com voted on patch set 2 V -1 04/12/20, 19:23 Completed build in 13m 25s on Sun, 12 Apr, 07:23 PM Test Summary: 18 of 73881 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2403

  7. TYPO3com voted on patch set 3 V -1 04/12/20, 19:37 Completed build in 15m 05s on Sun, 12 Apr, 07:37 PM Test Summary: 18 of 73881 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2405

  8. Benni Mack uploaded patch set 4 04/12/20, 19:39

  9. TYPO3com voted on patch set 4 V -1 04/12/20, 19:53 Completed build in 13m 14s on Sun, 12 Apr, 07:53 PM Test Summary: 18 of 73881 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2406

  10. Benni Mack uploaded patch set 5 04/12/20, 21:58

  11. Benni Mack uploaded patch set 6 04/12/20, 22:07

  12. TYPO3com voted on patch set 6 V -1 04/12/20, 22:07 Completed build in 25s on Sun, 12 Apr, 10:07 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2413

  13. Benni Mack uploaded patch set 7 04/12/20, 22:08

  14. TYPO3com voted on patch set 5 V -1 04/12/20, 22:12 Completed build in 13m 16s on Sun, 12 Apr, 10:12 PM Test Summary: 36 of 73923 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2412

  15. TYPO3com voted on patch set 7 V -1 04/12/20, 22:20 Completed build in 11m 59s on Sun, 12 Apr, 10:20 PM Test Summary: 36 of 73923 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2414

  1. Benni Mack uploaded patch set 8 04/13/20, 08:00

  2. TYPO3com voted on patch set 8 V -1 04/13/20, 08:12 Completed build in 12m 27s on Mon, 13 Apr, 08:12 AM Test Summary: 6 of 73941 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2421

  3. Benni Mack uploaded patch set 9 04/13/20, 08:38

  4. TYPO3com voted on patch set 9 V +1 04/13/20, 08:52 Completed build in 13m 40s on Mon, 13 Apr, 08:52 AM Test Summary: 73457 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2423

  5. Björn Jacob commented on patch set 9 04/13/20, 09:11

    @Benni: will this awesome feature adress this issue as well? https://forge.typo3.org/issues/82352 IMHO your patch could finally solve the problem, right?
  6. Benni Mack updated the commit message in patch set 10 04/13/20, 09:12

  7. Benni Mack commented on patch set 10 04/13/20, 09:12

    Yes, Björn! Thanks for the hint!
  8. TYPO3com voted on patch set 10 V +1 04/13/20, 09:29 Completed build in 16m 40s on Mon, 13 Apr, 09:29 AM Test Summary: 73457 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2426

  9. Björn Jacob commented on patch set 10 CR -1 04/13/20, 11:07

    Benni asked me to do a review of the RST files. Here it is :) Love this feature and good to see a form issue solved.

    TcaSelectItems.php:189 Unresolved

    "are"

    TcaSelectItems.php:194 Unresolved

    tbh I don't get this. Do we need this information? Can we add it to an own sentence?

    TcaSelectItems.php:202 Unresolved

    "The"

    TcaSelectItems.php:228 Unresolved

    "Put"

    TcaSelectItems.php:238 Unresolved

    "Put"

    TcaSelectItems.php:255 Unresolved

    "Let's"

    ExtensionManagementUtility.php:1239 Unresolved

    "an"

    Feature-91008-ItemGroupingForTCASelectItems.rst:14 Unresolved

    "which were then moved"

    Feature-91008-ItemGroupingForTCASelectItems.rst:16 Unresolved

    "plugins" - I would remove the "and" and use lowercase for "plugins"

    Feature-91008-ItemGroupingForTCASelectItems.rst:17 Unresolved

    "content types"

    Feature-91008-ItemGroupingForTCASelectItems.rst:19 Unresolved

    I would prefer an additional sentence: "Custom groups can be added via API or by defining TCA." I've changed the order to reflect the order of the examples below."

    Feature-91008-ItemGroupingForTCASelectItems.rst:24 Unresolved

    "The following two examples illustrate adding a new group to a field of type `select`."

    Feature-91008-ItemGroupingForTCASelectItems.rst:54 Unresolved

    Can you come up with an example when using the TCA definition is better? Or does the following paragraph is about this topic?

    Feature-91008-ItemGroupingForTCASelectItems.rst:68 Unresolved

    Should it be "content type" instead? Is it a technical term we normally spell that way?

    Feature-91008-ItemGroupingForTCASelectItems.rst:125 Unresolved

    There should be a newline above.

    Feature-91008-ItemGroupingForTCASelectItems.rst:129 Unresolved

    We do have different spellings when it comes to capitalization (within the first paragraph there is "page types"). What should we prefer?

    Feature-91008-ItemSortingForTCASelectItems.rst:19 Unresolved

    I don't get this. Does not feel right.

    Feature-91008-ItemSortingForTCASelectItems.rst:45 Unresolved

    "sorting is working on a"
  10. Georg Ringer voted on patch set 10 V +1 CR +1 04/13/20, 17:03

  11. Benni Mack uploaded patch set 11 04/14/20, 07:07

  12. TYPO3com voted on patch set 11 V +1 04/14/20, 07:19 Completed build in 11m 51s on Tue, 14 Apr, 07:19 AM Test Summary: 73505 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2475

  13. Björn Jacob commented on patch set 11 04/14/20, 07:27

    Awesome Benni. Thx for taking care. Found one minor thing.

    Feature-91008-ItemSortingForTCASelectItems.rst:19 Unresolved

    This "but" does not make much sense :)
  14. Benni Mack commented on patch set 12 04/14/20, 07:51

    Published edit on patch set 11.
  15. TYPO3com voted on patch set 12 V -1 04/14/20, 08:23 Completed build in 31m 23s on Tue, 14 Apr, 08:23 AM Test Summary: 73505 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2477

  16. TYPO3com voted on patch set 12 V +1 04/14/20, 08:45 Completed build in 1h 25m 23s on Tue, 14 Apr, 08:45 AM Test Summary: 73505 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2477

  17. Benni Mack uploaded patch set 13 04/14/20, 12:11

  18. TYPO3com voted on patch set 13 V +1 04/14/20, 12:29 Completed build in 16m 59s on Tue, 14 Apr, 12:28 PM Test Summary: 73520 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2495

  19. Georg Ringer voted on patch set 13 V +1 CR +1 04/14/20, 12:56

  20. Benni Mack uploaded patch set 14 04/15/20, 07:53

  21. TYPO3com voted on patch set 14 V +1 04/15/20, 08:17 Completed build in 18m 23s on Wed, 15 Apr, 08:17 AM Test Summary: 73568 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2551

  22. Georg Ringer voted on patch set 14 V +1 CR +1 04/15/20, 09:53

  23. Alexander Schnitzler commented on patch set 14 V +1 CR +1 04/15/20, 14:31

    Tested with ext news and works great.
  24. Benni Mack voted on patch set 14 V +2 CR +2 04/15/20, 15:44

  25. Benni Mack merged patch set 15 04/15/20, 15:44