Review main Merged

82171[FEATURE] Enable item groups for foreign_table

Oli Bartsch CR +2 V +2 Hard +345 −9 updated 01/04/24, 07:22

Commit message

It's now possible to define a specific field
for a foreign table, holding the id of an
associated item group. This therefore enables
the item groups feature also for select fields,
fetching its items from a foreign table.

The new option is called `foreign_table_item_group`.
In case an item group of a foreign item is not
defined in the `itemsGroup` config of the local
field, the group id is used as label. This is the
same as if a static item contains a not configured
group.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Anja Leichsenring +1
    • Nikita Hovratov +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Anja Leichsenring +1
    • Nikita Hovratov +1
    • core-ci +1 CI

Issues 2

Files 12

Review log 2837

Show 912 earlier messages
  1. Oli Bartsch uploaded patch set 1 12/11/23, 17:12

  2. core-ci voted on patch set 1 V +1 12/11/23, 17:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50567

  3. Mathias Brodala commented on patch set 1 12/12/23, 07:18

    AbstractItemProvider.php:362

    I wonder if we should use array_key_exists() instead here to avoid obscure bugs due to truthy/falsy values. These could very well be used intentionally for grouping items.
  4. Oli Bartsch commented on patch set 1 12/13/23, 10:13

    AbstractItemProvider.php:362 Reply

    What values are you thinking about? The value should be the groupId string, as documented in https://docs.typo3.org/m/typo3/reference-tca/main/en-us/ColumnsConfig/Type/Select/Properties/Items.html#items. We could think about using an empty() check, like done for the static items https://github.com/TYPO3/typo3/blob/main/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php#L166. But actually, the correct check - taking the docs into account - would be: `is_string($foreignRow[$itemGroupField] ?? false)`
  5. Mathias Brodala commented on patch set 1 12/13/23, 10:29

    AbstractItemProvider.php:362 Reply

    It was not clear from reading that the field on the foreign row is required to be a string. I thought it could be anything including numbers or similar. It could make sense to group by such values.
  6. Oli Bartsch uploaded patch set 2 V +1 12/14/23, 11:11

  7. Oli Bartsch commented on patch set 2 12/14/23, 11:15

    AbstractItemProvider.php:362 Reply

    Ok. To be fully consistent, a group is now always set for foreign_table items, as it's done in https://github.com/TYPO3/typo3/blob/main/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php#L1049C30-L1049C37 for all other items. Additionally, I added the link to the documentation, stating that this should be a string, to the RST.
  8. core-ci voted on patch set 2 V +1 12/14/23, 11:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50649

  9. Chris Müller uploaded patch set 3 V +1 12/14/23, 16:59

  10. core-ci voted on patch set 3 V +1 12/14/23, 17:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50659

  11. Nikita Hovratov uploaded patch set 4 V +1 12/15/23, 13:34

  12. Nikita Hovratov commented on patch set 4 12/15/23, 13:36

    I've added a field generator for the styleguide foreign table relation.
  1. core-ci voted on patch set 4 V +1 12/15/23, 13:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50700

  2. Nikita Hovratov voted on patch set 4 CR +1 V +1 12/15/23, 13:46

  3. Jochen Roth voted on patch set 4 CR +1 V +1 12/18/23, 08:43

  4. Christian Kuhn commented on patch set 4 CR -1 12/18/23, 10:22

    let's please wait with this until the 'db type=select fields' patch is in to not introduce new ext_tables.sql fields anymore.
  5. Oli Bartsch uploaded patch set 5 CR +1 V +1 12/19/23, 21:04

  6. Oli Bartsch commented on patch set 5 12/19/23, 21:04

    Reply

    Done
  7. Christian Kuhn commented on patch set 5 CR -1 12/19/23, 21:06

    Reply

    are the ext_tables.sql changes still needed?
  8. Oli Bartsch uploaded patch set 6 CR -1 12/19/23, 21:07

  9. Christian Kuhn commented on patch set 6 12/19/23, 21:09

    ext_tables.sql:119

    make it a varchar(255)? there is no need to make it bigger. (currently working on type=input auto-generation ;)
  10. core-ci voted on patch set 5 V +1 12/19/23, 21:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50822

  11. core-ci voted on patch set 6 V +1 12/19/23, 21:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50823

  12. Oli Bartsch uploaded patch set 7 V +1 12/19/23, 21:23

  13. Oli Bartsch commented on patch set 7 12/19/23, 21:24

    Reply

    Yes, since type=input is not yet covered by auto generation.

    ext_tables.sql:119 Reply

    Done
  14. core-ci voted on patch set 7 V +1 12/19/23, 21:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50824

  15. Oli Bartsch rebased onto patch set 8 V +1 12/27/23, 09:40

  16. core-ci voted on patch set 8 V +1 12/27/23, 09:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50962

  17. Anja Leichsenring voted on patch set 8 CR +1 V +1 01/03/24, 08:10

  18. Anja Leichsenring commented on patch set 8 V -1 01/03/24, 08:16

    some issue with varchar fields, Oli is informed.
  19. Oli Bartsch uploaded patch set 9 CR +1 V +1 01/03/24, 09:19

  20. Oli Bartsch commented on patch set 9 01/03/24, 09:20

    Reply

    No db issue, TCA 'allowNonIdValues' setting was missing.
  21. core-ci voted on patch set 9 V +1 01/03/24, 09:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51065

  22. Nikita Hovratov voted on patch set 9 CR +1 V +1 01/03/24, 22:20

  23. Anja Leichsenring voted on patch set 9 CR +1 V +1 01/04/24, 05:49

  24. Oli Bartsch voted on patch set 9 CR +2 V +2 01/04/24, 07:22

  25. Oli Bartsch merged patch set 10 01/04/24, 07:22