2 namespace TYPO3\CMS\Backend\Form\FormDataProvider;
39 foreach ($result[
'processedTca'][
'columns'] as $fieldName => $fieldConfig) {
40 if (empty($fieldConfig[
'config'][
'type']) || $fieldConfig[
'config'][
'type'] !==
'flex') {
65 $modifiedDataStructure = $result[
'processedTca'][
'columns'][$fieldName][
'config'][
'ds'];
66 if (isset($modifiedDataStructure[
'ROOT']) && isset($modifiedDataStructure[
'sheets'])) {
67 throw new \UnexpectedValueException(
68 'Parsed data structure has both ROOT and sheets on top level',
72 if (isset($modifiedDataStructure[
'ROOT']) && is_array($modifiedDataStructure[
'ROOT'])) {
73 $modifiedDataStructure[
'sheets'][
'sDEF'][
'ROOT'] = $modifiedDataStructure[
'ROOT'];
74 unset($modifiedDataStructure[
'ROOT']);
76 $result[
'processedTca'][
'columns'][$fieldName][
'config'][
'ds'] = $modifiedDataStructure;
93 $modifiedDataStructure = $result[
'processedTca'][
'columns'][$fieldName][
'config'][
'ds'];
95 $result[
'processedTca'][
'columns'][$fieldName][
'config'][
'ds'] = $modifiedDataStructure;
108 foreach ($structure as $key => $value) {
109 if ($key ===
'ROOT' && is_array($value) && isset($value[
'TCEforms'])) {
110 $value = array_merge($value, $value[
'TCEforms']);
111 unset($value[
'TCEforms']);
113 if ($key ===
'el' && is_array($value)) {
114 $newSubStructure = [];
115 foreach ($value as $subKey => $subValue) {
116 if (is_array($subValue) && count($subValue) === 1 && isset($subValue[
'TCEforms'])) {
117 $newSubStructure[$subKey] = $subValue[
'TCEforms'];
119 $newSubStructure[$subKey] = $subValue;
122 $value = $newSubStructure;
124 if (is_array($value)) {
127 $newStructure[$key] = $value;
129 return $newStructure;
141 $modifiedDataStructure = $result[
'processedTca'][
'columns'][$fieldName][
'config'][
'ds'];
143 $result[
'processedTca'][
'columns'][$fieldName][
'config'][
'ds'] = $modifiedDataStructure;
158 foreach ($structure as $key => $value) {
159 if ($key ===
'el' && is_array($value)) {
160 $newSubStructure = [];
162 foreach ($value as $subKey => $subValue) {
166 'dummyTable' => array(
168 'dummyField' => $subValue,
172 $migratedTca = $tcaMigration->migrate($dummyTca);
173 $messages = $tcaMigration->getMessages();
174 if (!empty($messages)) {
175 $context =
'FormEngine did an on-the-fly migration of a flex form data structure. This is deprecated and will be removed'
176 .
' with TYPO3 CMS 8. Merge the following changes into the flex form definition of table "' . $table .
'"" in field "' . $fieldName .
'"":';
177 array_unshift($messages, $context);
180 $newSubStructure[$subKey] = $migratedTca[
'dummyTable'][
'columns'][
'dummyField'];
182 $value = $newSubStructure;
184 if (is_array($value)) {
187 $newStructure[$key] = $value;
189 return $newStructure;