2 namespace TYPO3\CMS\Backend\Form\FormDataProvider;
36 public function addData(array $result)
38 foreach ($result[
'processedTca'][
'columns'] as $fieldName => $fieldConfig) {
39 if (empty($fieldConfig[
'config'][
'type'])
40 || $fieldConfig[
'config'][
'type'] !==
'group'
41 || empty($fieldConfig[
'config'][
'internal_type'])
46 $databaseRowFieldContent =
'';
47 if (!empty($result[
'databaseRow'][$fieldName])) {
48 $databaseRowFieldContent = (string)$result[
'databaseRow'][$fieldName];
51 $internalType = $fieldConfig[
'config'][
'internal_type'];
52 if ($internalType ===
'file_reference' || $internalType ===
'file') {
56 foreach ($fileList as $file) {
61 $result[
'databaseRow'][$fieldName] = implode(
',', $files);
62 }
elseif ($internalType ===
'db') {
65 $relationHandler->start(
66 $databaseRowFieldContent,
67 $fieldConfig[
'config'][
'allowed'],
68 $fieldConfig[
'config'][
'MM'],
69 $result[
'databaseRow'][
'uid'],
71 $fieldConfig[
'config']
73 $relationHandler->getFromDB();
74 $result[
'databaseRow'][$fieldName] = $relationHandler->readyForInterface();
77 throw new \UnexpectedValueException(
78 'TCA internal_type of field "' . $fieldName .
'" in table ' . $result[
'tableName']
79 .
' must be set to either "db", "file" or "file_reference"',