Task #69715
closedStory #69712: Further FormEngine development
Flex: Better encapsulation
100%
Description
getFlexIdentifier() of TcaFlex.php calculates the "pointer" that determines which defined data structure should be chosen.
The implementation is only sparse, documented stuff ( https://docs.typo3.org/typo3cms/TCAReference/Reference/Columns/Flex/Index.html ) like ds_pointerfield_searchparent is not handled.
getFlexFormDS() currently does two things: The pointer calculation and then fetching and parsing the structure. This should be split and unit tested put to FlexFormTools of ext:core (the only non-static class we have that handles flex form related stuff). Unsure about the error handling that is also happening - maybe better throw exceptions. Also the hint from resolvePossibleExternalFile() of TcaFlex should be taken into account and merged to the parser method.
There is a second (similar) method in BackendUtility::getRegisteredFlexForms that has a slightly different scope, though. The second one is used by the SelectItem data provider of flex forms, iirc.
In the end, the following methods should be deprecated and substituted by unit tested code within FlexFormTools that is split into sane capsules:
BackendUtility::getRegisteredFlexForms()
BackendUtility::getFlexFormDS
GeneralUtility::resolveSheetDefInDS()
GeneralUtility::resolveAllSheetsInDS()
It might be required to split this issue here into multiple smaller issues.