2 namespace TYPO3\CMS\Backend\Form\FormDataProvider;
35 if ($result[
'command'] !==
'new') {
38 if (!is_array($result[
'databaseRow'])) {
39 throw new \UnexpectedValueException(
40 'databaseRow of table ' . $result[
'tableName'] .
' is not an array',
54 $result[
'databaseRow'][
'pid'] = $result[
'vanillaUid'];
67 $tableNameWithDot = $result[
'tableName'] .
'.';
69 if (isset($result[
'userTsConfig'][
'TCAdefaults.'][$tableNameWithDot])
70 && is_array($result[
'userTsConfig'][
'TCAdefaults.'][$tableNameWithDot])
72 foreach ($result[
'userTsConfig'][
'TCAdefaults.'][$tableNameWithDot] as $fieldName => $fieldValue) {
73 if (isset($result[
'processedTca'][
'columns'][$fieldName])) {
74 $result[
'databaseRow'][$fieldName] = $fieldValue;
89 $tableNameWithDot = $result[
'tableName'] .
'.';
90 if (isset($result[
'pageTsConfig'][
'TCAdefaults.'][$tableNameWithDot])
91 && is_array($result[
'pageTsConfig'][
'TCAdefaults.'][$tableNameWithDot])
93 foreach ($result[
'pageTsConfig'][
'TCAdefaults.'][$tableNameWithDot] as $fieldName => $fieldValue) {
94 if (isset($result[
'processedTca'][
'columns'][$fieldName])) {
95 $result[
'databaseRow'][$fieldName] = $fieldValue;
111 if (is_array($result[
'neighborRow'])
112 && !empty($result[
'processedTca'][
'ctrl'][
'useColumnsForDefaultValues'])
115 foreach ($defaultColumns as $fieldName) {
116 if (isset($result[
'processedTca'][
'columns'][$fieldName])
117 && isset($result[
'neighborRow'][$fieldName])
119 $result[
'databaseRow'][$fieldName] = $result[
'neighborRow'][$fieldName];
138 $tableName = $result[
'tableName'];
140 if (isset($defaultValuesFromGetPost[$tableName])
141 && is_array($defaultValuesFromGetPost[$tableName])
143 foreach ($defaultValuesFromGetPost[$tableName] as $fieldName => $fieldValue) {
144 if (isset($result[
'processedTca'][
'columns'][$fieldName])) {
145 $result[
'databaseRow'][$fieldName] = $fieldValue;
164 if ($result[
'inlineChildChildUid'] === null) {
167 if (!is_int($result[
'inlineChildChildUid'])) {
168 throw new \UnexpectedValueException(
169 'An inlineChildChildUid is given for table ' . $result[
'tableName'] .
', but is not an integer',
173 if (!isset($result[
'inlineParentConfig'][
'foreign_selector'])) {
174 throw new \UnexpectedValueException(
175 'An inlineChildChildUid is given for table ' . $result[
'tableName'] .
', but no foreign_selector in inlineParentConfig',
179 $selectorFieldName = $result[
'inlineParentConfig'][
'foreign_selector'];
180 if (!isset($result[
'processedTca'][
'columns'][$selectorFieldName][
'config'][
'type'])
181 || ($result[
'processedTca'][
'columns'][$selectorFieldName][
'config'][
'type'] !==
'select'
182 && $result[
'processedTca'][
'columns'][$selectorFieldName][
'config'][
'type'] !==
'group'
185 throw new \UnexpectedValueException(
186 $selectorFieldName .
' is target type of a foreign_selector field to table ' . $result[
'tableName'] .
' and must be either a select or group type field',
191 if ($result[
'inlineChildChildUid']) {
192 $result[
'databaseRow'][$selectorFieldName] = $result[
'inlineChildChildUid'];