2 namespace TYPO3\CMS\Backend\Form\FormDataProvider;
33 $table = $result[
'tableName'];
35 foreach ($result[
'processedTca'][
'columns'] as $fieldName => $fieldConfig) {
36 if (empty($fieldConfig[
'config'][
'type']) || $fieldConfig[
'config'][
'type'] !==
'select') {
45 $fieldConfig[
'config'][
'items'] = $this->
sanitizeItemArray($fieldConfig[
'config'][
'items'], $table, $fieldName);
46 $fieldConfig[
'config'][
'maxitems'] = $this->
sanitizeMaxItems($fieldConfig[
'config'][
'maxitems']);
48 $fieldConfig[
'config'][
'items'] = $this->
addItemsFromSpecial($result, $fieldName, $fieldConfig[
'config'][
'items']);
49 $fieldConfig[
'config'][
'items'] = $this->
addItemsFromFolder($result, $fieldName, $fieldConfig[
'config'][
'items']);
50 $staticItems = $fieldConfig[
'config'][
'items'];
52 $fieldConfig[
'config'][
'items'] = $this->addItemsFromForeignTable($result, $fieldName, $fieldConfig[
'config'][
'items']);
53 $dynamicItems = array_diff_key($fieldConfig[
'config'][
'items'], $staticItems);
55 $removedItems = $fieldConfig[
'config'][
'items'];
58 $fieldConfig[
'config'][
'items'] = $this->
addItemsFromPageTsConfig($result, $fieldName, $fieldConfig[
'config'][
'items']);
65 $removedItems = array_diff_key($removedItems, $fieldConfig[
'config'][
'items']);
68 if (!empty($fieldConfig[
'config'][
'itemsProcFunc'])) {
69 $fieldConfig[
'config'][
'items'] = $this->resolveItemProcessorFunction($result, $fieldName, $fieldConfig[
'config'][
'items']);
71 unset($fieldConfig[
'config'][
'itemsProcFunc']);
76 $result[
'databaseRow'][$fieldName] = $currentDatabaseValuesArray;
78 $staticValues = $this->
getStaticValues($fieldConfig[
'config'][
'items'], $dynamicItems);
79 $result[
'databaseRow'][$fieldName] = $this->processSelectFieldValue($result, $fieldName, $staticValues);
86 $currentDatabaseValuesArray,
91 $fieldConfig[
'config'][
'items'] = $this->
translateLabels($result, $fieldConfig[
'config'][
'items'], $table, $fieldName);
94 $fieldConfig[
'config'][
'items'] = array_values($fieldConfig[
'config'][
'items']);
96 $result[
'processedTca'][
'columns'][$fieldName] = $fieldConfig;
117 if (empty($fieldConf[
'config'][
'items'])
118 || $fieldConf[
'config'][
'renderType'] !==
'selectSingle'
119 || $result[
'pageTsConfig'][
'TCEFORM.'][$table .
'.'][$fieldName .
'.'][
'disableNoMatchingValueElement']
120 || $fieldConf[
'config'][
'disableNoMatchingValueElement']
122 return $fieldConf[
'config'][
'items'];
126 $noMatchingLabel = isset($result[
'pageTsConfig'][
'TCEFORM.'][$table .
'.'][$fieldName .
'.'][
'noMatchingValue_label'])
127 ? $languageService->sL(trim($result[
'pageTsConfig'][
'TCEFORM.'][$table .
'.'][$fieldName .
'.'][
'noMatchingValue_label']))
128 :
'[ ' . $languageService->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.noMatchingValue') .
' ]';
130 $unmatchedValues = array_diff(
131 array_values($databaseValues),
132 array_column($fieldConf[
'config'][
'items'], 1),
133 array_column($removedItems, 1)
136 foreach ($unmatchedValues as $unmatchedValue) {
138 @sprintf($noMatchingLabel, $unmatchedValue),
141 array_unshift($fieldConf[
'config'][
'items'], $invalidItem);
144 return $fieldConf[
'config'][
'items'];
156 $fieldConfig[
'config'][
'renderType'],
157 [
'selectSingle',
'selectSingleBox',
'selectCheckBox',
'selectMultipleSideBySide'],