2 namespace TYPO3\CMS\Backend\Form\FormDataProvider;
42 foreach ($result[
'processedTca'][
'columns'] as $fieldName => $fieldConfig) {
45 ($fieldConfig[
'config'][
'type'] !==
'input' && $fieldConfig[
'config'][
'type'] !==
'text')
46 || !isset($fieldConfig[
'config'][
'placeholder'])
54 $fieldNameArray = array_slice(
58 $result[
'processedTca'][
'columns'][$fieldName][
'config'][
'placeholder'] = $this->
getPlaceholderValue($fieldNameArray, $result);
63 $result[
'processedTca'][
'columns'][$fieldName][
'config'][
'placeholder'] = $this->
getLanguageService()->sl($fieldConfig[
'config'][
'placeholder']);
67 if (empty($result[
'processedTca'][
'columns'][$fieldName][
'config'][
'placeholder'])) {
68 unset($result[
'processedTca'][
'columns'][$fieldName][
'config'][
'placeholder']);
87 if ($recursionLevel > 99) {
92 $fieldName = array_shift($fieldNameArray);
93 $fieldConfig = $result[
'processedTca'][
'columns'][$fieldName][
'config'];
97 if (!array_key_exists($fieldName, $result[
'databaseRow'])) {
101 $value = $result[
'databaseRow'][$fieldName];
103 switch ($fieldConfig[
'type']) {
107 $possibleUids = array_filter($value);
108 $foreignTableName = $fieldConfig[
'foreign_table'];
116 $foreignTableName = $fieldConfig[
'foreign_table'];
120 $foreignTableName =
'';
123 if (!empty($possibleUids) && !empty($fieldNameArray)) {
124 $relatedFormData = $this->getRelatedFormData($foreignTableName, $possibleUids[0], $fieldNameArray[0]);
125 $value = $this->
getPlaceholderValue($fieldNameArray, $relatedFormData, $recursionLevel + 1);
128 if ($recursionLevel === 0 && is_array($value)) {
129 $value = implode(
', ', $value);
131 return (
string)$value;
142 protected function getRelatedFormData($tableName, $uid, $columnToProcess)
146 'vanillaUid' => (int)$uid,
147 'tableName' => $tableName,
148 'inlineCompileExistingChildren' =>
false,
149 'columnsToProcess' => [$columnToProcess],
155 $compilerResult = $formDataCompiler->compile($fakeDataInput);
156 return $compilerResult;
175 if (($fieldConfig[
'internal_type'] !==
'db') || ($allowedTable ===
false)) {
180 foreach ($values as $groupValue) {
184 if (!empty($recordForeignTable) && ($recordForeignTable !== $allowedTable)) {
187 $relatedUids[] = $foreignUid;
203 $allowedTable =
false;
206 if (count($allowedTables) === 1) {
207 $allowedTable = $allowedTables[0];
210 return $allowedTable;