Review main Merged Breaking

87161[!!!][FEATURE] Remove ds_pointerField and simplify FlexForm handling

Oli Bartsch CR +2 V +2 Nightmare +5325 −2936 updated 07/30/25, 05:47

Commit message

This patch further simplifies FlexForm handling and configuration
in TCA and plugin registration, following the removal of subtypes
in #105538.

Key changes:

* Remove support for "ds_pointerField" and the legacy "ds"
  array format that used pointer field constructs to assign
  FlexForms to subtypes (e.g. 'list_type,CType' keys).

* FlexForms must now be assigned via standard "types"
  configurations using "columnsOverrides".

Example migration:

  Before:

    'columns' => [
        'pi_flexform' => [
            'config' => [
                'ds_pointerField' => 'list_type,CType',
                'ds' => [
                    'news_pi1,list' => 'FILE:EXT:news/...xml',
                    'default' => 'FILE:...'
                ]
            ]
        ]
    ]

  After:

    'columns' => [
        'pi_flexform' => [
            'config' => [
                'ds' => 'FILE:...'
            ]
        ]
    ],
    'types' => [
        'news_pi1' => [
            'columnsOverrides' => [
                'pi_flexform' => [
                    'config' => [
                        'ds' => 'FILE:EXT:news/...xml'
                    ]
                ]
            ]
        ]
    ]

If no "columnsOverrides" is defined for a record type,
the "ds" value in the field configuration applies as fallback.
Therefore, it has to be ensured that if the flex field
is not present in all types, the default field config
needs a valid value for "ds".

Migration:

* TcaMigration automatically converts single-entry "ds" arrays.
* Multi-entry arrays require manual migration to "types".

Additionally:

* `ExtensionManagementUtility::addPlugin()` and `ExtensionUtility::registerPlugin()`
  now accept an optional `$flexForm` argument, allowing extensions
  to pass the FlexForm data structure directly when registering a plugin.
  The parameter can be either a reference to a FlexForm XML file
  (e.g., "FILE:EXT:...") or the XML content itself.

* To resolve cycle dependencies and to no longer work with $GLOBALS
  in FlexFormTools, the methods getDataStructureIdentifier(),
  parseDataStructureByIdentifier() and cleanFlexFormXML() do now
  receive the schema (either a TCA Schema object or a raw TCA array)
  as argument. The service automatically routes to the appropriate
  internal methods. Both input types produce identical normalized
  output, ensuring that consumers of the :php:`FlexFormTools`
  service receive consistent data structures regardless of the
  input type used.

* Comprehensive test coverage added for FlexFormTools and RelationMapBuilder

Review

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

Issues 2

Files 72

Show 52 more files

Review log 5480

Show 3555 earlier messages
  1. Oli Bartsch uploaded patch set 1 11/21/24, 20:43

  2. core-ci voted on patch set 1 V -1 11/21/24, 20:53 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69988

  3. Benni Mack commented on patch set 1 11/22/24, 06:59

    ExtensionManagementUtility.php:852

    any chance we can make this in v13 as a pre-patch? I see this as a big convenience

    sys_file_storage.php:14

    any chance we make this as a prepatch also in v13?
  4. Simon Schaufelberger commented on patch set 1 12/16/24, 11:11

    ExtensionManagementUtility.php:852 Reply

    I'll do it!
  5. Simon Schaufelberger commented on patch set 1 12/16/24, 11:54

    ExtensionManagementUtility.php:852 Reply

    Done: https://review.typo3.org/c/Packages/TYPO3.CMS/+/87504 Please have a look if this fits the requirments

    ExtensionUtility.php:136

    this parameter needs to be after the SelectItem, not inside
  6. Lina Wolf commented on patch set 1 02/09/25, 06:15

    This initiative is very interesting! However, have you considered breaking it down into smaller parts? For example, the deprecation of ExtensionManagementUtility::addPiFlexFormValue() and the introduction of the parameter I suggested in https://review.typo3.org/c/Packages/TYPO3.CMS/+/88105would keep the TCA settings bundled in one place. Could your changes be based on that approach? Additionally, would it make sense to keep the changelog entries separate? While using utility functions like ExtensionManagementUtility and ExtensionUtility is common for extension and site package developers, fewer developers may be concerned with TCA settings for FlexForms. Do you think separating these changelogs would help target the right audience more effectively?
  7. Benni Mack uploaded patch set 2 V -1 03/10/25, 17:33

  8. Benni Mack commented on patch set 2 03/10/25, 17:36

    sys_file_storage.php:14 Reply

    Done
  9. core-ci voted on patch set 2 V -1 03/10/25, 18:01 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75431

  10. Benni Mack marked it work in progress 03/22/25, 12:33

  11. Benni Mack uploaded patch set 3 V -1 03/28/25, 08:37

  12. core-ci voted on patch set 3 V -1 03/28/25, 09:05 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76557

  13. Benni Mack uploaded patch set 4 V -1 03/28/25, 09:25

  14. core-ci voted on patch set 4 V -1 03/28/25, 10:01 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76560

  15. Benni Mack uploaded patch set 5 V -1 06/04/25, 14:55

  16. core-ci voted on patch set 5 V -1 06/04/25, 15:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79873

  17. Oli Bartsch uploaded patch set 6 V -1 06/11/25, 11:59

  18. core-ci voted on patch set 6 V -1 06/11/25, 12:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80196

  19. Oli Bartsch uploaded patch set 7 V -1 07/06/25, 08:39

  20. core-ci voted on patch set 7 V -1 07/06/25, 09:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81359

  21. Oli Bartsch uploaded patch set 8 V -1 07/06/25, 09:33

  22. core-ci voted on patch set 8 V -1 07/06/25, 09:42 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81363

  23. Oli Bartsch uploaded patch set 9 V -1 07/06/25, 13:27

  24. core-ci voted on patch set 9 V -1 07/06/25, 13:37 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81368

  25. Oli Bartsch uploaded patch set 10 V -1 07/06/25, 14:38

  26. Oli Bartsch uploaded patch set 11 07/06/25, 14:47

  27. core-ci voted on patch set 10 V -1 07/06/25, 14:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81372

  28. core-ci voted on patch set 11 V -1 07/06/25, 14:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81374

  29. Oli Bartsch uploaded patch set 12 V -1 07/06/25, 15:08

  30. core-ci voted on patch set 12 V +1 07/06/25, 15:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81376

  31. Oli Bartsch uploaded patch set 13 V +1 07/06/25, 15:47

  32. core-ci voted on patch set 13 V +1 07/06/25, 15:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81379

  33. Oli Bartsch commented on patch set 13 07/06/25, 16:01

    This change is ready for review.
  34. Oli Bartsch uploaded patch set 14 V +1 07/08/25, 14:47

  35. Oli Bartsch commented on patch set 14 07/08/25, 14:48

    ExtensionManagementUtility.php:852 Reply

    Done

    ExtensionUtility.php:136 Reply

    Done
  36. core-ci voted on patch set 14 V +1 07/08/25, 14:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81496

  37. Georg Ringer commented on patch set 14 07/09/25, 06:20

    if we go with breaking, can't we also rename "ds" to something more readable?
  38. Benni Mack commented on patch set 14 07/09/25, 09:18

    Feature-107047-AllowPassingFlexFormDirectlyInAddPluginAndRegisterPlugin.rst:45

    how about we split this feature away from the breaking change? As a "followup"?
  39. Oli Bartsch commented on patch set 14 07/09/25, 11:01

    Reply

    Why do you think that it’s not readable? What is your suggestion? I think this has to really improve the understanding since this requires a lot of change in core and people’s custom code, which might not be possible to automate via TCA Migration.

    Feature-107047-AllowPassingFlexFormDirectlyInAddPluginAndRegisterPlugin.rst:45 Reply

    What would be the benefit as this, according to the explanation in the rst, is directly linked to the other changes.
  40. Oli Bartsch commented on patch set 14 07/10/25, 16:31

    Feature-107047-AllowPassingFlexFormDirectlyInAddPluginAndRegisterPlugin.rst:45 Reply

    I’ve thought about this again, and especially considering the deprecation introduced in this patch, it makes sense to introduce the “alternative” option directly here.
  41. Oli Bartsch uploaded patch set 15 V +1 07/22/25, 11:33

  42. core-ci voted on patch set 15 V -1 07/22/25, 11:37 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82121

  43. Oli Bartsch uploaded patch set 16 V -1 07/22/25, 11:48

  44. Oli Bartsch uploaded patch set 17 07/22/25, 11:56

  45. core-ci voted on patch set 16 V -1 07/22/25, 11:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82122

  46. core-ci voted on patch set 17 V +1 07/22/25, 12:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82123

  47. Benni Mack commented on patch set 17 07/22/25, 18:53

    Feature-107047-AllowPassingFlexFormDirectlyInAddPluginAndRegisterPlugin.rst:45 Reply

    But then the commit message should state that this change is a new feature
  48. Oli Bartsch uploaded patch set 18 V +1 07/23/25, 20:52

  49. Oli Bartsch uploaded patch set 19 07/23/25, 20:53

  50. core-ci voted on patch set 18 V -1 07/23/25, 21:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82192

  51. core-ci voted on patch set 19 V -1 07/23/25, 21:06 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82193

  52. Oli Bartsch uploaded patch set 20 V -1 07/23/25, 21:07

  53. core-ci voted on patch set 20 V +1 07/23/25, 21:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82195

  54. Oli Bartsch commented on patch set 20 07/23/25, 21:19

    Reply

    Done

    Feature-107047-AllowPassingFlexFormDirectlyInAddPluginAndRegisterPlugin.rst:45 Reply

    Done
  55. Benni Mack commented on patch set 20 07/23/25, 21:43

    FlexFormTools.php:186

    as this method is internal and only used once in core, we could simply use TcaSchema as first argument, right?

    RelationMapBuilder.php:68

    any reason for this closure logic instead of using another class method (with proper comment etc) "processFlexFormStructure"?
  1. Simon Schaufelberger commented on patch set 20 07/23/25, 23:47

    Breaking-107047-RemovePointerFieldFunctionalityOfTCAFlex.rst:28

    Without ' as this is plural context

    Breaking-107047-RemovePointerFieldFunctionalityOfTCAFlex.rst:55

    without ' as this is plural context

    Breaking-107047-RemovePointerFieldFunctionalityOfTCAFlex.rst:83

    previously

    Breaking-107047-RemovePointerFieldFunctionalityOfTCAFlex.rst:98

    feature?

    Deprecation-107047-DeprecateExtensionUtilityaddPiFlexFormValue.rst:30

    double space used
  2. Oli Bartsch uploaded patch set 21 V +1 07/24/25, 07:29

  3. Oli Bartsch commented on patch set 20 07/24/25, 07:31

    FlexFormTools.php:186 Reply

    We could but I saw extensions are using this, e.g. news and also I actually don't see the benefit of moving this argument to the front.

    RelationMapBuilder.php:68 Reply

    No I just inlined it but I think for those three lines of code no further comment is needed.

    Breaking-107047-RemovePointerFieldFunctionalityOfTCAFlex.rst:28 Reply

    Done

    Breaking-107047-RemovePointerFieldFunctionalityOfTCAFlex.rst:55 Reply

    Done

    Breaking-107047-RemovePointerFieldFunctionalityOfTCAFlex.rst:83 Reply

    Done

    Breaking-107047-RemovePointerFieldFunctionalityOfTCAFlex.rst:98 Reply

    Done

    Deprecation-107047-DeprecateExtensionUtilityaddPiFlexFormValue.rst:30 Reply

    Done
  4. core-ci voted on patch set 21 V +1 07/24/25, 07:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82221

  5. Benni Mack commented on patch set 21 07/24/25, 08:01

    FlexFormTools.php:186 Reply

    Done
  6. Benni Mack uploaded patch set 22 V +1 07/24/25, 08:45

  7. Benni Mack updated the commit message in patch set 23 07/24/25, 08:46

  8. core-ci voted on patch set 22 V +1 07/24/25, 08:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82223

  9. core-ci voted on patch set 23 V +1 07/24/25, 08:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82224

  10. Benni Mack voted on patch set 23 CR +1 V +1 07/24/25, 12:49

  11. Christian Kuhn commented on patch set 23 07/28/25, 17:32

    FlexFormTools.php:50

    we could / should make clear that the 'TCA as array' part is an internal thing and 'casual' consumers should rely on the schema stuff only?

    FlexFormTools.php:695

    not 100% sure about the exception handling changes within this change. i'd like to have a slightly closer look on this since we probably want some to be global and bubble up, and others shouldn't.

    RelationMapBuilder.php:34

    i'm not 100% sure about this part of the change since FF has various unresolved quirks with relations. i'm thinking about extracting this part to an own change to sort out details. i'd suggest we talk about this part, and will ping you, Oli.

    ExtensionManagementUtility.php:896

    would be good to rename $piKeyToMatch to $_ - this is how i do this to make very obvious that this argument is unused and only still there to not break the signature. OTOH it does not matter much with the entire method being deprecated ;)

    FlexFormToolsTest.php:80

    could we inline the parts that are *really* needed for single tests into the single tests again and avoid the setUp() again? this creates some state that is hard to remember and only a couple of tests actually use them, and then override parts of it again. i think those tests would be easier to grasp if they keep their set-up tca in themselfs, plus it would be more obvious that so many other tests don't depend on it at all. what do you think?

    PagesAndTtContentWithRelationsAndSoftrefsTest.php:194

    oh. an old int-key indexed select item ... nice drive-by catch!
  12. Christian Kuhn commented on patch set 23 07/29/25, 13:59

    RelationMapBuilder.php:34 Reply

    scratch that. this part of the change only adapts what we have already.
  13. Christian Kuhn commented on patch set 23 07/29/25, 14:01

    this sentence is not true as such, would be good to adapt a bit.
  14. Oli Bartsch uploaded patch set 24 CR +1 V +1 07/29/25, 18:23

  15. core-ci voted on patch set 24 V +1 07/29/25, 18:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82507

  16. Oli Bartsch uploaded patch set 25 V +1 07/29/25, 20:44

  17. core-ci voted on patch set 25 V -1 07/29/25, 20:51 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82510

  18. Oli Bartsch uploaded patch set 26 V -1 07/29/25, 20:59

  19. Oli Bartsch commented on patch set 25 07/29/25, 21:02

    FlexFormTools.php:50 Reply

    I added comprehensive class comment and function documentation for this.

    FlexFormTools.php:695 Reply

    Revisited those exceptions and have a good feeling. I have only changed exceptions which should be caught, e.g. I have migrated "UnexpectedValueException" to "InvalidDataStructureException" because those might be triggered "on purpose" during build in the RelationMapBuilder etc.

    ExtensionManagementUtility.php:896 Reply

    Done

    FlexFormToolsTest.php:80 Reply

    Done
  20. Oli Bartsch commented on patch set 26 07/29/25, 21:02

    Reply

    Done
  21. core-ci voted on patch set 26 V +1 07/29/25, 21:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82511

  22. Christian Kuhn voted on patch set 26 CR +1 V +1 07/29/25, 22:04

  23. Benni Mack voted on patch set 26 CR +1 V +1 07/30/25, 05:39

  24. Oli Bartsch voted on patch set 26 CR +2 V +2 07/30/25, 05:47

  25. Oli Bartsch merged patch set 27 07/30/25, 05:47