[TASK] FormEngine: Allow for selective processing of TCA columns 23/43923/7
authorMorton Jonuschat <m.jonuschat@mojocode.de>
Fri, 9 Oct 2015 07:22:59 +0000 (09:22 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 9 Oct 2015 13:31:24 +0000 (15:31 +0200)
Add providers that take care of selecting the columns that need to be
processed for the given form data group. This allows removing all
columns not explicitly required by a prior provider (or manually filling
the list), streamlining the amount of work that needs to be done.

Resolves: #70504
Releases: master
Change-Id: I91ddb79ff929191b9c24047e870893a8cec207a1
Reviewed-on: http://review.typo3.org/43923
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
16 files changed:
typo3/sysext/backend/Classes/Form/FormDataCompiler.php
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaColumnsProcessCommon.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaColumnsProcessPlaceholders.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaColumnsProcessRecordTitle.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaColumnsProcessShowitem.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaColumnsRemoveUnused.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaInputPlaceholders.php
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaTypesRemoveUnusedColumns.php [deleted file]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsProcessCommonTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsProcessPlaceholdersTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsProcessRecordTitleTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsProcessShowitemTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsRemoveUnusedTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaInputPlaceholdersTest.php
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaTypesRemoveUnusedColumnsTest.php [deleted file]
typo3/sysext/core/Configuration/DefaultConfiguration.php

index 0024a4e..2b817a8 100644 (file)
@@ -172,6 +172,8 @@ class FormDataCompiler
             // TCA of table with processed fields. After processing, this array contains merged and resolved
             // array data, items were resolved, only used types are set, renderTypes are set.
             'processedTca' => array(),
+            // List of columns to be processed by data provider. Array value is the column name.
+            'columnsToProcess' => array(),
             // If set to TRUE, no wizards are calculated and rendered later
             'disabledWizards' => false,
             // BackendUser->uc['inlineView'] - This array holds status of expand / collapsed inline items
diff --git a/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaColumnsProcessCommon.php b/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaColumnsProcessCommon.php
new file mode 100644 (file)
index 0000000..da5a8dc
--- /dev/null
@@ -0,0 +1,65 @@
+<?php
+namespace TYPO3\CMS\Backend\Form\FormDataProvider;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Backend\Form\FormDataProviderInterface;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
+/**
+ * Mark columns that are common to many tables for further processing
+ */
+class TcaColumnsProcessCommon implements FormDataProviderInterface
+{
+    /**
+     * Determine which common fields are in use and add those to the list of
+     * columns that must be processed by the next data providers. Common fields
+     * are for example uid, transOrigPointerField or transOrigDiffSourceField.
+     *
+     * @param array $result
+     * @return array
+     */
+    public function addData(array $result)
+    {
+        // enables the backend to display a visual comparison between a new version and its original
+        $tableProperties = $result['processedTca']['ctrl'];
+        if (!empty($tableProperties['origUid'])) {
+            $result['columnsToProcess'][] = $tableProperties['origUid'];
+        }
+
+        // determines which one of the 'types' configurations are used for displaying the fields in the backend
+        if (!empty($tableProperties['type'])) {
+            // Allow for relation_field:foreign_type_field syntax
+            $fieldName = GeneralUtility::trimExplode(':', $tableProperties['type'], true, 2);
+            $result['columnsToProcess'][] = $fieldName[0];
+        }
+
+        // field that contains the language of the record
+        if (!empty($tableProperties['languageField'])) {
+            $result['columnsToProcess'][] = $tableProperties['languageField'];
+        }
+
+        // field that contains the pointer to the original record
+        if (!empty($tableProperties['transOrigPointerField'])) {
+            $result['columnsToProcess'][] = $tableProperties['transOrigPointerField'];
+        }
+
+        // field that contains the value of the original language record
+        if (!empty($tableProperties['transOrigDiffSourceField'])) {
+            $result['columnsToProcess'][] = $tableProperties['transOrigDiffSourceField'];
+        }
+
+        return $result;
+    }
+}
diff --git a/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaColumnsProcessPlaceholders.php b/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaColumnsProcessPlaceholders.php
new file mode 100644 (file)
index 0000000..b200aaa
--- /dev/null
@@ -0,0 +1,64 @@
+<?php
+namespace TYPO3\CMS\Backend\Form\FormDataProvider;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Backend\Form\FormDataProviderInterface;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Core\Utility\StringUtility;
+
+/**
+ * Mark columns that are used by input placeholders for further processing
+ */
+class TcaColumnsProcessPlaceholders implements FormDataProviderInterface
+{
+    /**
+     * Determine which fields are required to render the placeholders and
+     * add those to the list of columns that must be processed by the next
+     * data providers.
+     *
+     * @param array $result
+     * @return array
+     */
+    public function addData(array $result)
+    {
+        foreach ($result['processedTca']['columns'] as $fieldName => $fieldConfig) {
+            // Placeholders are only valid for input and text type fields
+            if (
+                ($fieldConfig['config']['type'] !== 'input' && $fieldConfig['config']['type'] !== 'text')
+                || !isset($fieldConfig['config']['placeholder'])
+            ) {
+                continue;
+            }
+
+            // Process __row|field type placeholders
+            if (StringUtility::beginsWith($fieldConfig['config']['placeholder'], '__row|')) {
+                // split field names into array and remove the __row indicator
+                $fieldNameArray = array_slice(
+                    GeneralUtility::trimExplode('|', $fieldConfig['config']['placeholder'], true),
+                    1
+                );
+
+                // only the first field is required to be processed as it's the one referring to
+                // the current record. All other columns will be resolved in a later pass through
+                // the related records.
+                if (!empty($fieldNameArray[0])) {
+                    $result['columnsToProcess'][] = $fieldNameArray[0];
+                }
+            }
+        }
+
+        return $result;
+    }
+}
diff --git a/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaColumnsProcessRecordTitle.php b/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaColumnsProcessRecordTitle.php
new file mode 100644 (file)
index 0000000..fa9e176
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+namespace TYPO3\CMS\Backend\Form\FormDataProvider;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Backend\Form\FormDataProviderInterface;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
+/**
+ * Mark columns that are used to generate the record title for
+ * further processing
+ */
+class TcaColumnsProcessRecordTitle implements FormDataProviderInterface
+{
+    /**
+     * Determine which fields are required to render the record title and
+     * add those to the list of columns that must be processed by the next
+     * data providers.
+     *
+     * @param array $result
+     * @return array
+     */
+    public function addData(array $result)
+    {
+        // If a field name is given for the label we need to process the field
+        if (!empty($result['processedTca']['ctrl']['label'])) {
+            $result['columnsToProcess'][] = $result['processedTca']['ctrl']['label'];
+        }
+
+        // Add alternative fields that might be used to render the label
+        if (!empty($result['processedTca']['ctrl']['label_alt'])) {
+            $labelColumns = GeneralUtility::trimExplode(',', $result['processedTca']['ctrl']['label_alt'], true);
+            $result['columnsToProcess'] = array_merge($result['columnsToProcess'], array_filter($labelColumns));
+        }
+
+        return $result;
+    }
+}
diff --git a/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaColumnsProcessShowitem.php b/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaColumnsProcessShowitem.php
new file mode 100644 (file)
index 0000000..83c2e7a
--- /dev/null
@@ -0,0 +1,70 @@
+<?php
+namespace TYPO3\CMS\Backend\Form\FormDataProvider;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Backend\Form\FormDataProviderInterface;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
+/**
+ * Mark columns that are used in showitem or palettes for further processing
+ */
+class TcaColumnsProcessShowitem implements FormDataProviderInterface
+{
+    /**
+     * Determine which fields are shown to the user and add those to the list of
+     * columns that must be processed by the next data providers.
+     *
+     * @param array $result
+     * @return array
+     */
+    public function addData(array $result)
+    {
+        $recordTypeValue = $result['recordTypeValue'];
+        if (empty($result['processedTca']['types'][$recordTypeValue]['showitem'])
+            || !is_string($result['processedTca']['types'][$recordTypeValue]['showitem'])
+            || empty($result['processedTca']['columns'])
+            || !is_array($result['processedTca']['columns'])
+        ) {
+            return $result;
+        }
+
+        $showItemFieldString = $result['processedTca']['types'][$recordTypeValue]['showitem'];
+        $showItemFieldArray = GeneralUtility::trimExplode(',', $showItemFieldString, true);
+
+        foreach ($showItemFieldArray as $fieldConfigurationString) {
+            $fieldConfigurationArray = GeneralUtility::trimExplode(';', $fieldConfigurationString);
+            $fieldName = $fieldConfigurationArray[0];
+            if ($fieldName === '--div--') {
+                continue;
+            }
+            if ($fieldName === '--palette--') {
+                if (isset($fieldConfigurationArray[2])) {
+                    $paletteName = $fieldConfigurationArray[2];
+                    if (!empty($result['processedTca']['palettes'][$paletteName]['showitem'])) {
+                        $paletteFields = GeneralUtility::trimExplode(',', $result['processedTca']['palettes'][$paletteName]['showitem'], true);
+                        foreach ($paletteFields as $paletteFieldConfiguration) {
+                            $paletteFieldConfigurationArray = GeneralUtility::trimExplode(';', $paletteFieldConfiguration);
+                            $result['columnsToProcess'][] = $paletteFieldConfigurationArray[0];
+                        }
+                    }
+                }
+            } else {
+                $result['columnsToProcess'][] = $fieldName;
+            }
+        }
+
+        return $result;
+    }
+}
diff --git a/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaColumnsRemoveUnused.php b/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaColumnsRemoveUnused.php
new file mode 100644 (file)
index 0000000..cbbe3b3
--- /dev/null
@@ -0,0 +1,43 @@
+<?php
+namespace TYPO3\CMS\Backend\Form\FormDataProvider;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Backend\Form\FormDataProviderInterface;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
+/**
+ * Remove fields from columns not in showitem or palette list.
+ * This is a relatively effective performance improvement preventing other
+ * providers from resolving stuff of fields that are not shown later.
+ * Especially effective for fal related tables.
+ */
+class TcaColumnsRemoveUnused implements FormDataProviderInterface
+{
+    /**
+     * Remove unused column fields to speed up further processing.
+     *
+     * @param array $result
+     * @return array
+     */
+    public function addData(array $result)
+    {
+        $columnsToRemove = array_diff(array_keys($result['processedTca']['columns']), $result['columnsToProcess']);
+        foreach ($columnsToRemove as $column) {
+            unset($result['processedTca']['columns'][$column]);
+        }
+
+        return $result;
+    }
+}
index 0dbf0f4..80a3687 100644 (file)
@@ -114,7 +114,7 @@ class TcaInputPlaceholders extends AbstractItemProvider implements FormDataProvi
         }
 
         if (!empty($possibleUids) && !empty($fieldNameArray)) {
-            $relatedFormData = $this->getRelatedFormData($foreignTableName, $possibleUids[0]);
+            $relatedFormData = $this->getRelatedFormData($foreignTableName, $possibleUids[0], $fieldNameArray[0]);
             $value = $this->getPlaceholderValue($fieldNameArray, $relatedFormData, $recursionLevel + 1);
         }
 
@@ -129,15 +129,17 @@ class TcaInputPlaceholders extends AbstractItemProvider implements FormDataProvi
      *
      * @param string $tableName Name of the table for which to compile formdata
      * @param int $uid UID of the record for which to compile the formdata
+     * @param string $columnToProcess The column that is required from the record
      * @return array The compiled formdata
      */
-    protected function getRelatedFormData($tableName, $uid)
+    protected function getRelatedFormData($tableName, $uid, $columnToProcess)
     {
         $fakeDataInput = [
             'command' => 'edit',
             'vanillaUid' => (int)$uid,
             'tableName' => $tableName,
             'inlineCompileExistingChildren' => false,
+            'columnsToProcess' => [$columnToProcess],
         ];
         /** @var TcaInputPlaceholderRecord $formDataGroup */
         $formDataGroup = GeneralUtility::makeInstance(TcaInputPlaceholderRecord::class);
diff --git a/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaTypesRemoveUnusedColumns.php b/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaTypesRemoveUnusedColumns.php
deleted file mode 100644 (file)
index b1d4afc..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-<?php
-namespace TYPO3\CMS\Backend\Form\FormDataProvider;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Backend\Form\FormDataProviderInterface;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-
-/**
- * Remove fields from columns not in showitem or palette list.
- * This is a relatively effective performance improvement preventing other
- * providers from resolving stuff of fields that are not shown later.
- * Especially effective for fal related tables.
- */
-class TcaTypesRemoveUnusedColumns implements FormDataProviderInterface
-{
-    /**
-     * Remove unused column fields to speed up further processing.
-     *
-     * @param array $result
-     * @return array
-     */
-    public function addData(array $result)
-    {
-        $recordTypeValue = $result['recordTypeValue'];
-        if (empty($result['processedTca']['types'][$recordTypeValue]['showitem'])
-            || !is_string($result['processedTca']['types'][$recordTypeValue]['showitem'])
-            || empty($result['processedTca']['columns'])
-            || !is_array($result['processedTca']['columns'])
-        ) {
-            return $result;
-        }
-
-        $showItemFieldString = $result['processedTca']['types'][$recordTypeValue]['showitem'];
-        $showItemFieldArray = GeneralUtility::trimExplode(',', $showItemFieldString, true);
-
-        // Do not remove fields that are used for record title calculation
-        $shownColumnFields = empty($result['processedTca']['ctrl']['label']) ? [] : [$result['processedTca']['ctrl']['label']];
-        if (!empty($result['processedTca']['ctrl']['label_alt'])) {
-            $shownColumnFields = array_merge(
-                $shownColumnFields,
-                GeneralUtility::trimExplode(',', $result['processedTca']['ctrl']['label_alt'], true)
-            );
-        }
-
-        foreach ($showItemFieldArray as $fieldConfigurationString) {
-            $fieldConfigurationArray = GeneralUtility::trimExplode(';', $fieldConfigurationString);
-            $fieldName = $fieldConfigurationArray[0];
-            if ($fieldName === '--div--') {
-                continue;
-            }
-            if ($fieldName === '--palette--') {
-                if (isset($fieldConfigurationArray[2])) {
-                    $paletteName = $fieldConfigurationArray[2];
-                    if (!empty($result['processedTca']['palettes'][$paletteName]['showitem'])) {
-                        $paletteFields = GeneralUtility::trimExplode(',', $result['processedTca']['palettes'][$paletteName]['showitem'], true);
-                        foreach ($paletteFields as $paletteFieldConfiguration) {
-                            $paletteFieldConfigurationArray = GeneralUtility::trimExplode(';', $paletteFieldConfiguration);
-                            $shownColumnFields[] = $paletteFieldConfigurationArray[0];
-                        }
-                    }
-                }
-            } else {
-                $shownColumnFields[] = $fieldName;
-            }
-        }
-        array_unique($shownColumnFields);
-        $columns = array_keys($result['processedTca']['columns']);
-        foreach ($columns as $column) {
-            if (!in_array($column, $shownColumnFields)) {
-                unset($result['processedTca']['columns'][$column]);
-            }
-        }
-
-        return $result;
-    }
-}
diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsProcessCommonTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsProcessCommonTest.php
new file mode 100644 (file)
index 0000000..29d8dff
--- /dev/null
@@ -0,0 +1,148 @@
+<?php
+namespace TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Core\Tests\UnitTestCase;
+use TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsProcessCommon;
+
+/**
+ * Test case
+ */
+class TcaColumnsProcessCommonTest extends UnitTestCase
+{
+    /**
+     * @var TcaColumnsProcessCommon
+     */
+    protected $subject;
+
+    protected function setUp()
+    {
+        $this->subject = new TcaColumnsProcessCommon();
+    }
+
+    /**
+     * @test
+     */
+    public function addDataRegistersOrigUidColumn()
+    {
+        $input = [
+            'columnsToProcess' => [],
+            'processedTca' => [
+                'ctrl' => [
+                    'origUid' => 't3_origuid'
+                ]
+            ]
+        ];
+
+        $expected = $input;
+        $expected['columnsToProcess'] = ['t3_origuid'];
+        $this->assertSame($expected, $this->subject->addData($input));
+    }
+
+    /**
+     * @test
+     */
+    public function addDataRegistersRecordTypeColumn()
+    {
+        $input = [
+            'columnsToProcess' => [],
+            'processedTca' => [
+                'ctrl' => [
+                    'type' => 'doktype'
+                ]
+            ]
+        ];
+
+        $expected = $input;
+        $expected['columnsToProcess'] = ['doktype'];
+        $this->assertSame($expected, $this->subject->addData($input));
+    }
+
+    /**
+     * @test
+     */
+    public function addDataRegistersRecordTypeRelationColumn()
+    {
+        $input = [
+            'columnsToProcess' => [],
+            'processedTca' => [
+                'ctrl' => [
+                    'type' => 'relation_field:foreign_type_field'
+                ]
+            ]
+        ];
+
+        $expected = $input;
+        $expected['columnsToProcess'] = ['relation_field'];
+        $this->assertSame($expected, $this->subject->addData($input));
+    }
+
+    /**
+     * @test
+     */
+    public function addDataRegistersLanguageFieldColumn()
+    {
+        $input = [
+            'columnsToProcess' => [],
+            'processedTca' => [
+                'ctrl' => [
+                    'languageField' => 'sys_language_uid'
+                ]
+            ]
+        ];
+
+        $expected = $input;
+        $expected['columnsToProcess'] = ['sys_language_uid'];
+        $this->assertSame($expected, $this->subject->addData($input));
+    }
+
+    /**
+     * @test
+     */
+    public function addDataRegistersTransOrigPointerColumn()
+    {
+        $input = [
+            'columnsToProcess' => [],
+            'processedTca' => [
+                'ctrl' => [
+                    'transOrigPointerField' => 'l10n_parent'
+                ]
+            ]
+        ];
+
+        $expected = $input;
+        $expected['columnsToProcess'] = ['l10n_parent'];
+        $this->assertSame($expected, $this->subject->addData($input));
+    }
+
+    /**
+     * @test
+     */
+    public function addDataRegistersTransOrigDiffSourceColumn()
+    {
+        $input = [
+            'columnsToProcess' => [],
+            'processedTca' => [
+                'ctrl' => [
+                    'transOrigDiffSourceField' => 'l18n_diffsource'
+                ]
+            ]
+        ];
+
+        $expected = $input;
+        $expected['columnsToProcess'] = ['l18n_diffsource'];
+        $this->assertSame($expected, $this->subject->addData($input));
+    }
+}
diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsProcessPlaceholdersTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsProcessPlaceholdersTest.php
new file mode 100644 (file)
index 0000000..f738391
--- /dev/null
@@ -0,0 +1,105 @@
+<?php
+namespace TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Core\Tests\UnitTestCase;
+use TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsProcessPlaceholders;
+
+/**
+ * Test case
+ */
+class TcaColumnsProcessPlaceholdersTest extends UnitTestCase
+{
+    /**
+     * @var TcaColumnsProcessPlaceholders
+     */
+    protected $subject;
+
+    protected function setUp()
+    {
+        $this->subject = new TcaColumnsProcessPlaceholders();
+    }
+
+    /**
+     * @test
+     */
+    public function addDataRegistersPlaceholderColumns()
+    {
+        $input = [
+            'columnsToProcess' => [],
+            'processedTca' => [
+                'columns' => [
+                    'aField' => [
+                        'config' => [
+                            'type' => 'input',
+                            'placeholder' => '__row|anotherField'
+                        ],
+                    ],
+                ],
+            ]
+        ];
+
+        $expected = $input;
+        $expected['columnsToProcess'] = ['anotherField'];
+        $this->assertSame($expected, $this->subject->addData($input));
+    }
+
+    /**
+     * @test
+     */
+    public function addDataRegistersFirstPlaceholderColumn()
+    {
+        $input = [
+            'columnsToProcess' => [],
+            'processedTca' => [
+                'columns' => [
+                    'aField' => [
+                        'config' => [
+                            'type' => 'input',
+                            'placeholder' => '__row|uid_local|metadata|title'
+                        ],
+                    ],
+                ],
+            ]
+        ];
+
+        $expected = $input;
+        $expected['columnsToProcess'] = ['uid_local'];
+        $this->assertSame($expected, $this->subject->addData($input));
+    }
+
+    /**
+     * @test
+     */
+    public function addDataRegistersAlternativeLabelColumnn()
+    {
+        $input = [
+            'columnsToProcess' => [],
+            'processedTca' => [
+                'columns' => [
+                    'aField' => [
+                        'config' => [
+                            'type' => 'input',
+                            'placeholder' => 'A simple placeholder'
+                        ],
+                    ],
+                ],
+            ]
+        ];
+
+        $expected = $input;
+        $this->assertSame($expected, $this->subject->addData($input));
+    }
+}
diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsProcessRecordTitleTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsProcessRecordTitleTest.php
new file mode 100644 (file)
index 0000000..f3bdfe3
--- /dev/null
@@ -0,0 +1,75 @@
+<?php
+namespace TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Core\Tests\UnitTestCase;
+use TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsProcessRecordTitle;
+
+/**
+ * Test case
+ */
+class TcaColumnsProcessRecordTitleTest extends UnitTestCase
+{
+    /**
+     * @var TcaColumnsProcessRecordTitle
+     */
+    protected $subject;
+
+    protected function setUp()
+    {
+        $this->subject = new TcaColumnsProcessRecordTitle();
+    }
+
+    /**
+     * @test
+     */
+    public function addDataRegistersLabelColumn()
+    {
+        $input = [
+            'columnsToProcess' => [],
+            'processedTca' => [
+                'ctrl' => [
+                    'label' => 'uid'
+                ],
+                'columns' => [],
+            ]
+        ];
+
+        $expected = $input;
+        $expected['columnsToProcess'] = ['uid'];
+        $this->assertSame($expected, $this->subject->addData($input));
+    }
+
+    /**
+     * @test
+     */
+    public function addDataRegistersAlternativeLabelColumnn()
+    {
+        $input = [
+            'columnsToProcess' => [],
+            'processedTca' => [
+                'ctrl' => [
+                    'label' => 'uid',
+                    'label_alt' => 'aField,anotherField',
+                ],
+                'columns' => [],
+            ]
+        ];
+
+        $expected = $input;
+        $expected['columnsToProcess'] = ['uid','aField','anotherField'];
+        $this->assertSame($expected, $this->subject->addData($input));
+    }
+}
diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsProcessShowitemTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsProcessShowitemTest.php
new file mode 100644 (file)
index 0000000..8096835
--- /dev/null
@@ -0,0 +1,156 @@
+<?php
+namespace TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Core\Tests\UnitTestCase;
+use TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsProcessShowitem;
+
+/**
+ * Test case
+ */
+class TcaColumnsProcessShowitemTest extends UnitTestCase
+{
+    /**
+     * @var TcaColumnsProcessShowitem
+     */
+    protected $subject;
+
+    protected function setUp()
+    {
+        $this->subject = new TcaColumnsProcessShowitem();
+    }
+
+    /**
+     * @test
+     */
+    public function addDataRegistersColumnsFieldReferencedInShowitems()
+    {
+        $input = [
+            'columnsToProcess' => [],
+            'databaseRow' => [],
+            'recordTypeValue' => 'aType',
+            'processedTca' => [
+                'types' => [
+                    'aType' => [
+                        'showitem' => 'keepMe'
+                    ],
+                ],
+                'columns' => [
+                    'keepMe' => [
+                        'config' => [
+                            'type' => 'input',
+                        ]
+                    ],
+                    'aField' => [
+                        'config' => [
+                            'type' => 'input',
+                        ]
+                    ]
+                ]
+            ]
+        ];
+
+        $expected = $input;
+        $expected['columnsToProcess'] = ['keepMe'];
+
+        $this->assertSame($expected, $this->subject->addData($input));
+    }
+
+    /**
+     * @test
+     */
+    public function addDataKeepsColumnsFieldReferencedInPalette()
+    {
+        $input = [
+            'columnsToProcess' => [],
+            'databaseRow' => [],
+            'recordTypeValue' => 'aType',
+            'processedTca' => [
+                'types' => [
+                    'aType' => [
+                        'showitem' => '--palette--;;aPalette'
+                    ],
+                ],
+                'palettes' => [
+                    'aPalette' => [
+                        'showitem' => 'keepMe',
+                    ],
+                ],
+                'columns' => [
+                    'keepMe' => [
+                        'config' => [
+                            'type' => 'input',
+                        ]
+                    ],
+                    'bField' => [
+                        'config' => [
+                            'type' => 'input',
+                        ]
+                    ]
+                ]
+            ]
+        ];
+
+        $expected = $input;
+        $expected['columnsToProcess'] = ['keepMe'];
+
+        $this->assertSame($expected, $this->subject->addData($input));
+    }
+
+    /**
+     * @test
+     */
+    public function addDataSkipsColumnsNotReferencedInShowitemOrPalette()
+    {
+        $input = [
+            'databaseRow' => [],
+            'recordTypeValue' => 'aType',
+            'processedTca' => [
+                'types' => [
+                    'aType' => [
+                        'showitem' => '--palette--;;aPalette, anotherField'
+                    ],
+                ],
+                'palettes' => [
+                    'aPalette' => [
+                        'showitem' => 'aField',
+                    ],
+                ],
+                'columns' => [
+                    'aField' => [
+                        'config' => [
+                            'type' => 'input',
+                        ]
+                    ],
+                    'removeMe' => [
+                        'config' => [
+                            'type' => 'input',
+                        ]
+                    ],
+                    'anotherField' => [
+                        'config' => [
+                            'type' => 'input',
+                        ]
+                    ]
+                ]
+            ]
+        ];
+
+        $expected = $input;
+        $expected['columnsToProcess'] = ['aField', 'anotherField'];
+
+        $this->assertSame($expected, $this->subject->addData($input));
+    }
+}
diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsRemoveUnusedTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsRemoveUnusedTest.php
new file mode 100644 (file)
index 0000000..5c4bf4e
--- /dev/null
@@ -0,0 +1,68 @@
+<?php
+namespace TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsRemoveUnused;
+use TYPO3\CMS\Core\Tests\UnitTestCase;
+
+/**
+ * Test case
+ */
+class TcaColumnsRemoveUnusedTest extends UnitTestCase
+{
+    /**
+     * @var TcaColumnsRemoveUnused
+     */
+    protected $subject;
+
+    protected function setUp()
+    {
+        $this->subject = new TcaColumnsRemoveUnused();
+    }
+
+    /**
+     * @test
+     */
+    public function addDataKeepsColumnsToProcess()
+    {
+        $input = [
+            'columnsToProcess' => ['keepMe', 'keepMeToo'],
+            'processedTca' => [
+                'columns' => [
+                    'keepMe' => [
+                        'config' => [
+                            'type' => 'input',
+                        ]
+                    ],
+                    'keepMeToo' => [
+                        'config' => [
+                            'type' => 'input',
+                        ]
+                    ],
+                    'aField' => [
+                        'config' => [
+                            'type' => 'input',
+                        ]
+                    ]
+                ]
+            ]
+        ];
+
+        $expected = $input;
+        unset($expected['processedTca']['columns']['aField']);
+
+        $this->assertSame($expected, $this->subject->addData($input));
+    }
+}
index ff58f0f..b90a849 100644 (file)
@@ -162,7 +162,13 @@ class TcaInputPlaceholdersTest extends UnitTestCase
         /** @var TcaInputPlaceholderRecord $languageService */
         $formDataCompilerProphecy = $this->prophesize(FormDataCompiler::class);
         GeneralUtility::addInstance(FormDataCompiler::class, $formDataCompilerProphecy->reveal());
-        $formDataCompilerProphecy->compile(['command' => 'edit', 'vanillaUid' => 42, 'tableName' => 'aForeignTable', 'inlineCompileExistingChildren' => false])
+        $formDataCompilerProphecy->compile([
+            'command' => 'edit',
+            'vanillaUid' => 42,
+            'tableName' => 'aForeignTable',
+            'inlineCompileExistingChildren' => false,
+            'columnsToProcess' => ['aForeignField']
+        ])
             ->shouldBeCalled()
             ->willReturn($aForeignTableInput);
 
@@ -221,7 +227,13 @@ class TcaInputPlaceholdersTest extends UnitTestCase
         /** @var TcaInputPlaceholderRecord $languageService */
         $formDataCompilerProphecy = $this->prophesize(FormDataCompiler::class);
         GeneralUtility::addInstance(FormDataCompiler::class, $formDataCompilerProphecy->reveal());
-        $formDataCompilerProphecy->compile(['command' => 'edit', 'vanillaUid' => 3, 'tableName' => 'sys_file', 'inlineCompileExistingChildren' => false])
+        $formDataCompilerProphecy->compile([
+            'command' => 'edit',
+            'vanillaUid' => 3,
+            'tableName' => 'sys_file',
+            'inlineCompileExistingChildren' => false,
+            'columnsToProcess' => ['sha1']
+        ])
             ->shouldBeCalled()
             ->willReturn($sysFileProphecyResult);
 
@@ -281,7 +293,13 @@ class TcaInputPlaceholdersTest extends UnitTestCase
         /** @var TcaInputPlaceholderRecord $languageService */
         $formDataCompilerProphecy = $this->prophesize(FormDataCompiler::class);
         GeneralUtility::addInstance(FormDataCompiler::class, $formDataCompilerProphecy->reveal());
-        $formDataCompilerProphecy->compile(['command' => 'edit', 'vanillaUid' => 2, 'tableName' => 'sys_file_metadata', 'inlineCompileExistingChildren' => false])
+        $formDataCompilerProphecy->compile([
+            'command' => 'edit',
+            'vanillaUid' => 2,
+            'tableName' => 'sys_file_metadata',
+            'inlineCompileExistingChildren' => false,
+            'columnsToProcess' => ['title']
+        ])
             ->shouldBeCalled()
             ->willReturn($sysFileMetadataProphecyResult);
 
@@ -358,13 +376,25 @@ class TcaInputPlaceholdersTest extends UnitTestCase
 
         $sysFileFormDataCompilerProphecy = $this->prophesize(FormDataCompiler::class);
         GeneralUtility::addInstance(FormDataCompiler::class, $sysFileFormDataCompilerProphecy->reveal());
-        $sysFileFormDataCompilerProphecy->compile(['command' => 'edit', 'vanillaUid' => 3, 'tableName' => 'sys_file', 'inlineCompileExistingChildren' => false])
+        $sysFileFormDataCompilerProphecy->compile([
+            'command' => 'edit',
+            'vanillaUid' => 3,
+            'tableName' => 'sys_file',
+            'inlineCompileExistingChildren' => false,
+            'columnsToProcess' => ['metadata']
+        ])
             ->shouldBeCalled()
             ->willReturn($sysFileProphecyResult);
 
         $sysFileMetaDataFormDataCompilerProphecy = $this->prophesize(FormDataCompiler::class);
         GeneralUtility::addInstance(FormDataCompiler::class, $sysFileMetaDataFormDataCompilerProphecy->reveal());
-        $sysFileMetaDataFormDataCompilerProphecy->compile(['command' => 'edit', 'vanillaUid' => 7, 'tableName' => 'sys_file_metadata', 'inlineCompileExistingChildren' => false])
+        $sysFileMetaDataFormDataCompilerProphecy->compile([
+            'command' => 'edit',
+            'vanillaUid' => 7,
+            'tableName' => 'sys_file_metadata',
+            'inlineCompileExistingChildren' => false,
+            'columnsToProcess' => ['title']
+        ])
             ->shouldBeCalled()
             ->willReturn($sysFileMetadataProphecyResult);
 
diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaTypesRemoveUnusedColumnsTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaTypesRemoveUnusedColumnsTest.php
deleted file mode 100644 (file)
index 4cec860..0000000
+++ /dev/null
@@ -1,251 +0,0 @@
-<?php
-namespace TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Backend\Form\FormDataProvider\TcaTypesRemoveUnusedColumns;
-use TYPO3\CMS\Core\Tests\UnitTestCase;
-
-/**
- * Test case
- */
-class TcaTypesRemoveUnusedColumnsTest extends UnitTestCase
-{
-    /**
-     * @var TcaTypesRemoveUnusedColumns
-     */
-    protected $subject;
-
-    protected function setUp()
-    {
-        $this->subject = new TcaTypesRemoveUnusedColumns();
-    }
-
-    /**
-     * @test
-     */
-    public function addDataKeepsColumnsFieldReferencedInShowitems()
-    {
-        $input = [
-            'databaseRow' => [],
-            'recordTypeValue' => 'aType',
-            'processedTca' => [
-                'types' => [
-                    'aType' => [
-                        'showitem' => 'keepMe'
-                    ],
-                ],
-                'columns' => [
-                    'keepMe' => [
-                        'config' => [
-                            'type' => 'input',
-                        ]
-                    ],
-                    'aField' => [
-                        'config' => [
-                            'type' => 'input',
-                        ]
-                    ]
-                ]
-            ]
-        ];
-
-        $expected = $input;
-        unset($expected['processedTca']['columns']['aField']);
-
-        $this->assertSame($expected, $this->subject->addData($input));
-    }
-
-    /**
-     * @test
-     */
-    public function addDataKeepsColumnsFieldReferencedInPalette()
-    {
-        $input = [
-            'databaseRow' => [],
-            'recordTypeValue' => 'aType',
-            'processedTca' => [
-                'types' => [
-                    'aType' => [
-                        'showitem' => '--palette--;;aPalette'
-                    ],
-                ],
-                'palettes' => [
-                    'aPalette' => array(
-                        'showitem' => 'keepMe',
-                    ),
-                ],
-                'columns' => [
-                    'keepMe' => [
-                        'config' => [
-                            'type' => 'input',
-                        ]
-                    ],
-                    'bField' => [
-                        'config' => [
-                            'type' => 'input',
-                        ]
-                    ]
-                ]
-            ]
-        ];
-
-        $expected = $input;
-        unset($expected['processedTca']['columns']['bField']);
-
-        $this->assertSame($expected, $this->subject->addData($input));
-    }
-
-    /**
-     * @test
-     */
-    public function addDataRemovesColumnsNotReferencedInShowitemOrPalette()
-    {
-        $input = [
-            'databaseRow' => [],
-            'recordTypeValue' => 'aType',
-            'processedTca' => [
-                'types' => [
-                    'aType' => [
-                        'showitem' => '--palette--;;aPalette, anotherField'
-                    ],
-                ],
-                'palettes' => [
-                    'aPalette' => array(
-                        'showitem' => 'aField',
-                    ),
-                ],
-                'columns' => [
-                    'aField' => [
-                        'config' => [
-                            'type' => 'input',
-                        ]
-                    ],
-                    'removeMe' => [
-                        'config' => [
-                            'type' => 'input',
-                        ]
-                    ],
-                    'anotherField' => [
-                        'config' => [
-                            'type' => 'input',
-                        ]
-                    ]
-                ]
-            ]
-        ];
-
-        $expected = $input;
-        unset($expected['processedTca']['columns']['removeMe']);
-
-        $this->assertSame($expected, $this->subject->addData($input));
-    }
-
-    /**
-     * @test
-     */
-    public function addDataKeepsColumnsFieldReferencedInLabel()
-    {
-        $input = [
-            'databaseRow' => [],
-            'recordTypeValue' => 'aType',
-            'processedTca' => [
-                'ctrl' => [
-                    'label' => 'keepMe'
-                ],
-                'types' => [
-                    'aType' => [
-                        'showitem' => 'keepMeToo'
-                    ],
-                ],
-                'palettes' => [
-                    'aPalette' => array(
-                        'showitem' => 'keepMe',
-                    ),
-                ],
-                'columns' => [
-                    'keepMe' => [
-                        'config' => [
-                            'type' => 'input',
-                        ]
-                    ],
-                    'keepMeToo' => [
-                        'config' => [
-                            'type' => 'input',
-                        ]
-                    ],
-                    'aField' => [
-                        'config' => [
-                            'type' => 'input',
-                        ]
-                    ]
-                ]
-            ]
-        ];
-
-        $expected = $input;
-        unset($expected['processedTca']['columns']['aField']);
-
-        $this->assertSame($expected, $this->subject->addData($input));
-    }
-
-    /**
-     * @test
-     */
-    public function addDataKeepsColumnsFieldReferencedInLabelAlt()
-    {
-        $input = [
-            'databaseRow' => [],
-            'recordTypeValue' => 'aType',
-            'processedTca' => [
-                'ctrl' => [
-                    'label' => 'keepMe',
-                    'label_alt' => 'keepMeToo'
-                ],
-                'types' => [
-                    'aType' => [
-                        'showitem' => 'keepMe'
-                    ],
-                ],
-                'palettes' => [
-                    'aPalette' => array(
-                        'showitem' => 'keepMe',
-                    ),
-                ],
-                'columns' => [
-                    'keepMe' => [
-                        'config' => [
-                            'type' => 'input',
-                        ]
-                    ],
-                    'keepMeToo' => [
-                        'config' => [
-                            'type' => 'input',
-                        ]
-                    ],
-                    'aField' => [
-                        'config' => [
-                            'type' => 'input',
-                        ]
-                    ]
-                ]
-            ]
-        ];
-
-        $expected = $input;
-        unset($expected['processedTca']['columns']['aField']);
-
-        $this->assertSame($expected, $this->subject->addData($input));
-    }
-}
index 59284b2..56852f7 100644 (file)
@@ -409,17 +409,41 @@ return array(
                             \TYPO3\CMS\Backend\Form\FormDataProvider\InitializeProcessedTca::class,
                         ),
                     ),
-                    \TYPO3\CMS\Backend\Form\FormDataProvider\TcaTypesShowitem::class => array(
+                    \TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsProcessCommon::class => array(
+                        'depends' => array(
+                            \TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsOverrides::class
+                        ),
+                    ),
+                    \TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsProcessRecordTitle::class => array(
+                        'depends' => array(
+                            \TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsOverrides::class
+                        ),
+                    ),
+                    \TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsProcessPlaceholders::class => array(
+                        'depends' => array(
+                            \TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsOverrides::class
+                        ),
+                    ),
+                    \TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsProcessShowitem::class => array(
                         'depends' => array(
-                            \TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseRecordTypeValue::class,
-                            \TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseSystemLanguageRows::class,
-                            \TYPO3\CMS\Backend\Form\FormDataProvider\InitializeProcessedTca::class,
                             \TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsOverrides::class
                         ),
                     ),
-                    \TYPO3\CMS\Backend\Form\FormDataProvider\TcaTypesRemoveUnusedColumns::class => array(
+                    \TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsRemoveUnused::class => array(
+                        'depends' => array(
+                            \TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsOverrides::class,
+                            \TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsProcessCommon::class,
+                            \TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsProcessRecordTitle::class,
+                            \TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsProcessPlaceholders::class,
+                            \TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsProcessShowitem::class,
+                        ),
+                    ),
+                    \TYPO3\CMS\Backend\Form\FormDataProvider\TcaTypesShowitem::class => array(
                         'depends' => array(
-                            \TYPO3\CMS\Backend\Form\FormDataProvider\TcaTypesShowitem::class
+                            \TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseRecordTypeValue::class,
+                            \TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseSystemLanguageRows::class,
+                            \TYPO3\CMS\Backend\Form\FormDataProvider\InitializeProcessedTca::class,
+                            \TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsRemoveUnused::class
                         ),
                     ),
                     \TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexFetch::class => array(
@@ -427,7 +451,7 @@ return array(
                             \TYPO3\CMS\Backend\Form\FormDataProvider\InitializeProcessedTca::class,
                             \TYPO3\CMS\Backend\Form\FormDataProvider\UserTsConfig::class,
                             \TYPO3\CMS\Backend\Form\FormDataProvider\PageTsConfigMerged::class,
-                            \TYPO3\CMS\Backend\Form\FormDataProvider\TcaTypesRemoveUnusedColumns::class,
+                            \TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsRemoveUnused::class,
                         ),
                     ),
                     \TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexPrepare::class => array(
@@ -458,7 +482,7 @@ return array(
                             \TYPO3\CMS\Backend\Form\FormDataProvider\PageTsConfigMerged::class,
                             \TYPO3\CMS\Backend\Form\FormDataProvider\InitializeProcessedTca::class,
                             \TYPO3\CMS\Backend\Form\FormDataProvider\TcaTypesShowitem::class,
-                            \TYPO3\CMS\Backend\Form\FormDataProvider\TcaTypesRemoveUnusedColumns::class,
+                            \TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsRemoveUnused::class,
                             \TYPO3\CMS\Backend\Form\FormDataProvider\TcaCheckboxItems::class,
                             // GeneralUtility::getFlexFormDS() needs unchanged databaseRow values as string
                             \TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexFetch::class,
@@ -561,20 +585,25 @@ return array(
                             \TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseRecordTypeValue::class,
                         ),
                     ),
-                    \TYPO3\CMS\Backend\Form\FormDataProvider\TcaRadioItems::class => array(
+                    \TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsRemoveUnused::class => array(
                         'depends' => array(
                             \TYPO3\CMS\Backend\Form\FormDataProvider\InitializeProcessedTca::class,
                         ),
                     ),
+                    \TYPO3\CMS\Backend\Form\FormDataProvider\TcaRadioItems::class => array(
+                        'depends' => array(
+                            \TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsRemoveUnused::class,
+                        ),
+                    ),
                     \TYPO3\CMS\Backend\Form\FormDataProvider\TcaCheckboxItems::class => array(
                         'depends' => array(
-                            \TYPO3\CMS\Backend\Form\FormDataProvider\InitializeProcessedTca::class,
+                            \TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsRemoveUnused::class,
                             \TYPO3\CMS\Backend\Form\FormDataProvider\TcaRadioItems::class
                         ),
                     ),
                     \TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems::class => array(
                         'depends' => array(
-                            \TYPO3\CMS\Backend\Form\FormDataProvider\InitializeProcessedTca::class,
+                            \TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsRemoveUnused::class,
                             \TYPO3\CMS\Backend\Form\FormDataProvider\TcaCheckboxItems::class,
                         ),
                     ),