Project

General

Profile

Actions

Feature #101879

open

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

Added by Nikolas Hagelstein 8 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2023-09-08
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

  1. Story
    As a developer i want to be able to use a database independent treeConfig/DataProvider in TCA/FlexForms select fields of renderType selectTree.
  1. 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

  1. 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.
  1. 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 :)

No data to display

Actions

Also available in: Atom PDF