2 namespace TYPO3\CMS\Backend\Form\FormDataProvider;
34 $recordTypeValue = $result[
'recordTypeValue'];
36 if (!isset($result[
'processedTca'][
'types'][$recordTypeValue][
'showitem'])
37 || !is_string($result[
'processedTca'][
'types'][$recordTypeValue][
'showitem'])
39 throw new \UnexpectedValueException(
40 'No or invalid showitem definition in TCA table ' . $result[
'tableName'] .
' for type ' . $recordTypeValue,
45 if (empty($result[
'processedTca'][
'columns'])) {
50 $addShowItemFieldsToColumnsToProcess =
true;
51 if ($result[
'isInlineChild']) {
53 $isExistingRecord = $result[
'command'] ===
'edit';
54 $inlineConfig = $result[
'inlineParentConfig'];
55 $collapseAll = isset($inlineConfig[
'appearance'][
'collapseAll']) && $inlineConfig[
'appearance'][
'collapseAll'];
56 $expandCollapseStateArray = $result[
'inlineExpandCollapseStateArray'];
57 $foreignTable = $result[
'inlineParentConfig'][
'foreign_table'];
58 $isExpandedByUcState = isset($expandCollapseStateArray[$foreignTable])
59 && is_array($expandCollapseStateArray[$foreignTable])
60 && in_array($result[
'databaseRow'][
'uid'], $expandCollapseStateArray[$foreignTable]) !==
false;
61 if ($isExistingRecord && ($collapseAll || !$isExpandedByUcState) && !$result[
'isInlineAjaxOpeningContext']) {
62 $addShowItemFieldsToColumnsToProcess =
false;
66 if (!$addShowItemFieldsToColumnsToProcess) {
70 $showItemFieldString = $result[
'processedTca'][
'types'][$recordTypeValue][
'showitem'];
73 foreach ($showItemFieldArray as $fieldConfigurationString) {
75 $fieldName = $fieldConfigurationArray[0];
76 if ($fieldName ===
'--div--') {
79 if ($fieldName ===
'--palette--') {
80 if (isset($fieldConfigurationArray[2])) {
81 $paletteName = $fieldConfigurationArray[2];
82 if (!empty($result[
'processedTca'][
'palettes'][$paletteName][
'showitem'])) {
84 foreach ($paletteFields as $paletteFieldConfiguration) {
86 $result[
'columnsToProcess'][] = $paletteFieldConfigurationArray[0];
91 $result[
'columnsToProcess'][] = $fieldName;