Issue Feature Resolved

#101879Decouple TYPO3\CMS\Core\Tree\TableConfiguration\TreeDataProviderFactory from Database/DatabaseTreeDataProvider

Nikolas Hagelstein 09/08/23, 08:31 updated 11/12/26, 21:35

Description

## Story
As a developer i want to be able to use a database independent treeConfig/DataProvider in TCA/FlexForms select fields of renderType selectTree.

## Details
ATM the TreeDataProviderFactory is tightly coupled to the internal implementation of the DatabaseTreeDataProvider.
It checks for ‘foreign_table’, ‘childrenField’ and ‘parentField’ while this should be done by the specific TreeDataProvider itself.

With the removal of the “internal_type” check this behavior forces you to set thoose fields even if your treeDataProvide is not even using a database see:
https://github.com/TYPO3/typo3/commit/6f557ac5aae1b44f882dfbe09d60c2f68ce3534d#diff-2a75aeb556ea1fbf95b8ff85c45804ae0141c922fe2b1561362fa91555ce0c40L69

## Example
Lets say you want to provide TreeData from remote Source e.g. a Webservice.
In this case you need to provide dummy foreign_table, ChildrenField and ParentField as well as adding the corresponding setters to your TreeDataProvider even though they are not used at all.

## Solution
Leave the TCA Checks to the Dataprovider itself.
Remove the tight coupling to the DatabaseTreeProvider:
https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Classes/Tree/TableConfiguration/TreeDataProviderFactory.php#L71
https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Classes/Tree/TableConfiguration/TreeDataProviderFactory.php#L73
https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Classes/Tree/TableConfiguration/TreeDataProviderFactory.php#L80
https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Classes/Tree/TableConfiguration/TreeDataProviderFactory.php#L112

A treeConfig with a custom TreeDataProvider is not “invalid” if “foreign_table” or the child/Parent field is missing :)

Reviews 2

History 310

  1. Garvin Hicking commented and changed category status New Needs Feedback <span data-processor="relativetime" data-value="2024-07-31T10:36:15+00:00" > 07/31/24, 10:36 </span>

    Thanks for the report. You seem to have a good idea about how your proposal could go, would you be interested in providing your idea as a patch?

  2. Gerrit Code Review pushed patch set 1 for main to change 97572 status Needs Feedback Under Review <span data-processor="relativetime" data-value="2026-11-12T09:39:08+00:00" > 11/12/26, 09:39 </span>

  3. Benni Mack commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-11-12T21:10:13+00:00" > 11/12/26, 21:10 </span>

    Applied in changeset commit:3828f81fba53c55f100a47f2d7c1fa61d8b83a68.

  4. Gerrit Code Review pushed patch set 2 for 14.3 to change 97592 status Resolved Under Review <span data-processor="relativetime" data-value="2026-11-12T21:12:06+00:00" > 11/12/26, 21:12 </span>

  5. Benni Mack commented and changed status Under Review Resolved <span data-processor="relativetime" data-value="2026-11-12T21:35:12+00:00" > 11/12/26, 21:35 </span>

    Applied in changeset commit:8593504a79a2bc1266aa193be9a43e15f3802a52.