[!!!][TASK] Drop core 6->7 auto TCA migrations 41/59341/3
authorChristian Kuhn <lolli@schwarzbu.ch>
Sat, 5 Jan 2019 15:07:29 +0000 (16:07 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Sun, 6 Jan 2019 12:34:51 +0000 (13:34 +0100)
The TcaMigration class to auto migrate existing TCA
to new specs before it is cached has been added with
core v7.
The patch now finally removes all migrations that
changed core v6 compatible TCA to core v7 compatible
TCA.

Resolves: #87335
Releases: master
Change-Id: Ie5734d4c0bcee83ce74591d6de39a50c12d4386a
Reviewed-on: https://review.typo3.org/59341
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Tests/UnitDeprecated/Form/FormDataProvider/TcaFlexPrepareTest.php
typo3/sysext/core/Classes/Migrations/TcaMigration.php
typo3/sysext/core/Documentation/Changelog/master/Breaking-87193-DeprecatedFunctionalityRemoved.rst
typo3/sysext/core/Tests/Unit/Migrations/TcaMigrationTest.php

index e1f83ce..90b37d4 100644 (file)
@@ -94,22 +94,9 @@ class TcaFlexPrepareTest extends UnitTestCase
                                                             <TCEforms>
                                                                 <label>aFlexFieldLabel</label>
                                                                 <config>
-                                                                    <type>text</type>
-                                                                    <default>defaultValue</default>
-                                                                    <wizards>
-                                                                        <t3editor>
-                                                                            <type>userFunc</type>
-                                                                            <userFunc>TYPO3\\CMS\\T3editor\\FormWizard->main</userFunc>
-                                                                            <title>t3editor</title>
-                                                                            <icon>content-table</icon>
-                                                                            <module>
-                                                                                <name>wizard_table</name>
-                                                                            </module>
-                                                                            <params>
-                                                                                <format>html</format>
-                                                                            </params>
-                                                                        </t3editor>
-                                                                    </wizards>
+                                                                    <type>input</type>
+                                                                    <renderType>inputDateTime</renderType>
+                                                                    <max>42</max>
                                                                 </config>
                                                             </TCEforms>
                                                         </aFlexField>
@@ -140,10 +127,8 @@ class TcaFlexPrepareTest extends UnitTestCase
                             'aFlexField' => [
                                 'label' => 'aFlexFieldLabel',
                                 'config' => [
-                                    'type' => 'text',
-                                    'default' => 'defaultValue',
-                                    'renderType' => 't3editor',
-                                    'format' => 'html',
+                                    'type' => 'input',
+                                    'renderType' => 'inputDateTime',
                                 ],
                             ],
                         ],
@@ -196,22 +181,9 @@ class TcaFlexPrepareTest extends UnitTestCase
                                                                             <TCEforms>
                                                                                 <label>aFlexFieldLabel</label>
                                                                                 <config>
-                                                                                    <type>text</type>
-                                                                                    <default>defaultValue</default>
-                                                                                    <wizards>
-                                                                                        <t3editor>
-                                                                                            <type>userFunc</type>
-                                                                                            <userFunc>TYPO3\\CMS\\T3editor\\FormWizard->main</userFunc>
-                                                                                            <title>t3editor</title>
-                                                                                            <icon>content-table</icon>
-                                                                                            <module>
-                                                                                                <name>wizard_table</name>
-                                                                                            </module>
-                                                                                            <params>
-                                                                                                <format>html</format>
-                                                                                            </params>
-                                                                                        </t3editor>
-                                                                                    </wizards>
+                                                                                    <type>input</type>
+                                                                                    <renderType>inputDateTime</renderType>
+                                                                                    <max>42</max>
                                                                                 </config>
                                                                             </TCEforms>
                                                                         </aFlexField>
@@ -255,10 +227,8 @@ class TcaFlexPrepareTest extends UnitTestCase
                                             'aFlexField' => [
                                                 'label' => 'aFlexFieldLabel',
                                                 'config' => [
-                                                    'type' => 'text',
-                                                    'default' => 'defaultValue',
-                                                    'renderType' => 't3editor',
-                                                    'format' => 'html',
+                                                    'type' => 'input',
+                                                    'renderType' => 'inputDateTime',
                                                 ],
                                             ],
                                         ],
index b5a8f57..d0eb08c 100644 (file)
@@ -49,17 +49,6 @@ class TcaMigration
         $this->validateTcaType($tca);
 
         $tca = $this->migrateColumnsConfig($tca);
-        $tca = $this->migrateT3editorWizardToRenderTypeT3editorIfNotEnabledByTypeConfig($tca);
-        $tca = $this->migrateSpecialConfigurationAndRemoveShowItemStylePointerConfig($tca);
-        $tca = $this->migrateT3editorWizardWithEnabledByTypeConfigToColumnsOverrides($tca);
-        $tca = $this->migrateShowItemAdditionalPaletteToOwnPalette($tca);
-        $tca = $this->migrateIconsForFormFieldWizardToNewLocation($tca);
-        $tca = $this->migrateExtAndSysextPathToEXTPath($tca);
-        $tca = $this->migrateIconsInOptionTags($tca);
-        $tca = $this->migrateIconfileRelativePathOrFilenameOnlyToExtReference($tca);
-        $tca = $this->migrateSelectFieldRenderType($tca);
-        $tca = $this->migrateSelectFieldIconTable($tca);
-        $tca = $this->migrateElementBrowserWizardToLinkHandler($tca);
         $tca = $this->migrateDefaultExtrasRteTransFormOptions($tca);
         $tca = $this->migrateSelectTreeOptions($tca);
         $tca = $this->migrateTSconfigSoftReferences($tca);
@@ -86,7 +75,7 @@ class TcaMigration
         $tca = $this->migrateOptionsOfTypeGroup($tca);
         $tca = $this->migrateSelectShowIconTable($tca);
         $tca = $this->migrateImageManipulationConfig($tca);
-        $tca = $this->migrateinputDateTimeMax($tca);
+        $tca = $this->migrateInputDateTimeMax($tca);
         $tca = $this->migrateInlineOverrideChildTca($tca);
         $tca = $this->migrateLocalizeChildrenAtParentLocalization($tca);
         $tca = $this->migratePagesLanguageOverlayRemoval($tca);
@@ -154,587 +143,6 @@ class TcaMigration
     }
 
     /**
-     * Migrate type=text field with t3editor wizard to renderType=t3editor without this wizard
-     *
-     * @param array $tca Incoming TCA
-     * @return array Migrated TCA
-     */
-    protected function migrateT3editorWizardToRenderTypeT3editorIfNotEnabledByTypeConfig(array $tca): array
-    {
-        $newTca = $tca;
-        foreach ($tca as $table => $tableDefinition) {
-            if (!isset($tableDefinition['columns']) || !is_array($tableDefinition['columns'])) {
-                continue;
-            }
-            foreach ($tableDefinition['columns'] as $fieldName => $fieldConfig) {
-                if (
-                    !empty($fieldConfig['config']['type']) // type is set
-                    && trim($fieldConfig['config']['type']) === 'text' // to "text"
-                    && isset($fieldConfig['config']['wizards'])
-                    && is_array($fieldConfig['config']['wizards']) // and there are wizards
-                ) {
-                    foreach ($fieldConfig['config']['wizards'] as $wizardName => $wizardConfig) {
-                        if (
-                            !empty($wizardConfig['userFunc']) // a userFunc is defined
-                            && trim($wizardConfig['userFunc']) === 'TYPO3\\CMS\\T3editor\\FormWizard->main' // and set to FormWizard
-                            && (
-                                !isset($wizardConfig['enableByTypeConfig']) // and enableByTypeConfig is not set
-                                || (isset($wizardConfig['enableByTypeConfig']) && !$wizardConfig['enableByTypeConfig'])  // or set, but not enabled
-                            )
-                        ) {
-                            // Set renderType from text to t3editor
-                            $newTca[$table]['columns'][$fieldName]['config']['renderType'] = 't3editor';
-                            // Unset this wizard definition
-                            unset($newTca[$table]['columns'][$fieldName]['config']['wizards'][$wizardName]);
-                            // Move format parameter
-                            if (!empty($wizardConfig['params']['format'])) {
-                                $newTca[$table]['columns'][$fieldName]['config']['format'] = $wizardConfig['params']['format'];
-                            }
-                            $this->messages[] = 'The t3editor wizard using \'type\' = \'text\' has been migrated to a \'renderType\' = \'t3editor\' definition.'
-                            . 'It has been migrated from TCA "' . $table . '[\'columns\'][\'' . $fieldName . '\'][\'config\'][\'wizards\'][\'t3editor\']"'
-                            . 'to "' . $table . '[\'columns\'][\'' . $fieldName . '\'][\'config\'][\'renderType\'] = \'t3editor\'"';
-                        }
-                    }
-                    // If no wizard is left after migration, unset the whole sub array
-                    if (empty($newTca[$table]['columns'][$fieldName]['config']['wizards'])) {
-                        unset($newTca[$table]['columns'][$fieldName]['config']['wizards']);
-                    }
-                }
-            }
-        }
-        return $newTca;
-    }
-
-    /**
-     * Remove "style pointer", the 5th parameter from "types" "showitem" configuration.
-     * Move "specConf", 4th parameter from "types" "showitem" to "types" "columnsOverrides".
-     *
-     * @param array $tca Incoming TCA
-     * @return array Modified TCA
-     */
-    protected function migrateSpecialConfigurationAndRemoveShowItemStylePointerConfig(array $tca): array
-    {
-        $newTca = $tca;
-        foreach ($tca as $table => $tableDefinition) {
-            if (!isset($tableDefinition['types']) || !is_array($tableDefinition['types'])) {
-                continue;
-            }
-            foreach ($tableDefinition['types'] as $typeName => $typeArray) {
-                if (!isset($typeArray['showitem']) || !is_string($typeArray['showitem']) || strpos($typeArray['showitem'], ';') === false) {
-                    // Continue directly if no semicolon is found
-                    continue;
-                }
-                $itemList = GeneralUtility::trimExplode(',', $typeArray['showitem'], true);
-                $newFieldStrings = [];
-                foreach ($itemList as $fieldString) {
-                    $fieldString = rtrim($fieldString, ';');
-                    // Unpack the field definition, migrate and remove as much as possible
-                    // Keep empty parameters in trimExplode here (third parameter FALSE), so position is not changed
-                    $fieldArray = GeneralUtility::trimExplode(';', $fieldString);
-                    $fieldArray = [
-                        'fieldName' => $fieldArray[0] ?? '',
-                        'fieldLabel' => $fieldArray[1] ?? null,
-                        'paletteName' => $fieldArray[2] ?? null,
-                        'fieldExtra' => $fieldArray[3] ?? null,
-                    ];
-                    if (!empty($fieldArray['fieldExtra'])) {
-                        // Move fieldExtra "specConf" to columnsOverrides "defaultExtras"
-                        if (!isset($newTca[$table]['types'][$typeName]['columnsOverrides'])) {
-                            $newTca[$table]['types'][$typeName]['columnsOverrides'] = [];
-                        }
-                        if (!isset($newTca[$table]['types'][$typeName]['columnsOverrides'][$fieldArray['fieldName']])) {
-                            $newTca[$table]['types'][$typeName]['columnsOverrides'][$fieldArray['fieldName']] = [];
-                        }
-                        // Merge with given defaultExtras from columns.
-                        // They will be the first part of the string, so if "specConf" from types changes the same settings,
-                        // those will override settings from defaultExtras of columns
-                        $newDefaultExtras = [];
-                        if (!empty($tca[$table]['columns'][$fieldArray['fieldName']]['defaultExtras'])) {
-                            $newDefaultExtras[] = $tca[$table]['columns'][$fieldArray['fieldName']]['defaultExtras'];
-                        }
-                        $newDefaultExtras[] = $fieldArray['fieldExtra'];
-                        $newTca[$table]['types'][$typeName]['columnsOverrides'][$fieldArray['fieldName']]['defaultExtras'] = implode(':', $newDefaultExtras);
-                    }
-                    unset($fieldArray['fieldExtra']);
-                    if (count($fieldArray) === 3 && empty($fieldArray['paletteName'])) {
-                        unset($fieldArray['paletteName']);
-                    }
-                    if (count($fieldArray) === 2 && empty($fieldArray['fieldLabel'])) {
-                        unset($fieldArray['fieldLabel']);
-                    }
-                    $newFieldString = implode(';', $fieldArray);
-                    if ($newFieldString !== $fieldString) {
-                        $this->messages[] = 'The 4th parameter \'specConf\' of the field \'showitem\' with fieldName = \'' . $fieldArray['fieldName'] . '\' has been migrated, from TCA table "'
-                            . $table . '[\'types\'][\'' . $typeName . '\'][\'showitem\']"' . 'to "'
-                            . $table . '[\'types\'][\'' . $typeName . '\'][\'columnsOverrides\'][\'' . $fieldArray['fieldName'] . '\'][\'defaultExtras\']".';
-                    }
-                    if (count($fieldArray) === 1 && empty($fieldArray['fieldName'])) {
-                        // The field may vanish if nothing is left
-                        unset($fieldArray['fieldName']);
-                    }
-                    if (!empty($newFieldString)) {
-                        $newFieldStrings[] = $newFieldString;
-                    }
-                }
-                $newTca[$table]['types'][$typeName]['showitem'] = implode(',', $newFieldStrings);
-            }
-        }
-        return $newTca;
-    }
-
-    /**
-     * Migrate type=text field with t3editor wizard that is "enableByTypeConfig" to columnsOverrides
-     * with renderType=t3editor
-     *
-     * @param array $tca Incoming TCA
-     * @return array Migrated TCA
-     */
-    protected function migrateT3editorWizardWithEnabledByTypeConfigToColumnsOverrides(array $tca): array
-    {
-        $newTca = $tca;
-        foreach ($tca as $table => $tableDefinition) {
-            if (!isset($tableDefinition['columns']) || !is_array($tableDefinition['columns'])) {
-                continue;
-            }
-            foreach ($tableDefinition['columns'] as $fieldName => $fieldConfig) {
-                if (
-                    !empty($fieldConfig['config']['type']) // type is set
-                    && trim($fieldConfig['config']['type']) === 'text' // to "text"
-                    && isset($fieldConfig['config']['wizards'])
-                    && is_array($fieldConfig['config']['wizards']) // and there are wizards
-                ) {
-                    foreach ($fieldConfig['config']['wizards'] as $wizardName => $wizardConfig) {
-                        if (
-                            !empty($wizardConfig['userFunc']) // a userFunc is defined
-                            && trim($wizardConfig['userFunc']) === 'TYPO3\CMS\T3editor\FormWizard->main' // and set to FormWizard
-                            && !empty($wizardConfig['enableByTypeConfig']) // and enableByTypeConfig is enabled
-                        ) {
-                            // Remove this wizard
-                            unset($newTca[$table]['columns'][$fieldName]['config']['wizards'][$wizardName]);
-                            // Find configured types that use this wizard
-                            if (!isset($tableDefinition['types']) || !is_array($tableDefinition['types'])) {
-                                // No type definition at all ... continue directly
-                                continue;
-                            }
-                            foreach ($tableDefinition['types'] as $typeName => $typeArray) {
-                                if (
-                                    empty($typeArray['columnsOverrides'][$fieldName]['defaultExtras'])
-                                    || strpos($typeArray['columnsOverrides'][$fieldName]['defaultExtras'], $wizardName) === false
-                                ) {
-                                    // Continue directly if this wizard is not enabled for given type
-                                    continue;
-                                }
-                                $defaultExtras = $typeArray['columnsOverrides'][$fieldName]['defaultExtras'];
-                                $defaultExtrasArray = GeneralUtility::trimExplode(':', $defaultExtras, true);
-                                $newDefaultExtrasArray = [];
-                                foreach ($defaultExtrasArray as $fieldExtraField) {
-                                    // There might be multiple enabled wizards separated by | ... split them
-                                    if (strpos($fieldExtraField, 'wizards[') === 0) {
-                                        $enabledWizards = substr($fieldExtraField, 8, strlen($fieldExtraField) - 8); // Cut off "wizards[
-                                        $enabledWizards = substr($enabledWizards, 0, strlen($enabledWizards) - 1);
-                                        $enabledWizardsArray = GeneralUtility::trimExplode('|', $enabledWizards, true);
-                                        $newEnabledWizardsArray = [];
-                                        foreach ($enabledWizardsArray as $enabledWizardName) {
-                                            if ($enabledWizardName === $wizardName) {
-                                                // Found a columnsOverrides configuration that has this wizard enabled
-                                                // Force renderType = t3editor
-                                                $newTca[$table]['types'][$typeName]['columnsOverrides'][$fieldName]['config']['renderType'] = 't3editor';
-                                                // Transfer format option if given
-                                                if (!empty($wizardConfig['params']['format'])) {
-                                                    $newTca[$table]['types'][$typeName]['columnsOverrides'][$fieldName]['config']['format'] = $wizardConfig['params']['format'];
-                                                }
-                                                $this->messages[] = 'The t3editor wizard using \'type\' = \'text\', with the "enableByTypeConfig" wizard set to 1,'
-                                                . 'has been migrated to the \'renderType\' = \'t3editor\' definition.'
-                                                . 'It has been migrated from TCA "' . $table . '[\'columns\'][\'' . $fieldName . '\'][\'config\'][\'wizards\'][\'t3editor\']"'
-                                                . 'to "' . $table . '[\'columns\'][\'' . $fieldName . '\'][\'config\'][\'renderType\'] = \'t3editor\'"';
-                                            } else {
-                                                // Some other enabled wizard
-                                                $newEnabledWizardsArray[] = $enabledWizardName;
-                                            }
-                                        }
-                                        if (!empty($newEnabledWizardsArray)) {
-                                            $newDefaultExtrasArray[] = 'wizards[' . implode('|', $newEnabledWizardsArray) . ']';
-                                        }
-                                    } else {
-                                        $newDefaultExtrasArray[] = $fieldExtraField;
-                                    }
-                                }
-                                if (!empty($newDefaultExtrasArray)) {
-                                    $newTca[$table]['types'][$typeName]['columnsOverrides'][$fieldName]['defaultExtras'] = implode(':', $newDefaultExtrasArray);
-                                } else {
-                                    unset($newTca[$table]['types'][$typeName]['columnsOverrides'][$fieldName]['defaultExtras']);
-                                }
-                            }
-                        }
-                    }
-                    // If no wizard is left after migration, unset the whole sub array
-                    if (empty($newTca[$table]['columns'][$fieldName]['config']['wizards'])) {
-                        unset($newTca[$table]['columns'][$fieldName]['config']['wizards']);
-                    }
-                }
-            }
-        }
-        return $newTca;
-    }
-
-    /**
-     * Migrate types showitem 'aField;aLabel;aPalette' to 'afield;aLabel, --palette--;;aPalette'
-     *
-     * Old showitem can have a syntax like:
-     * fieldName;aLabel;aPalette
-     * This way, the palette with name "aPalette" is rendered after fieldName.
-     * The migration parses this to a syntax like:
-     * fieldName;aLabel, --palette--;;paletteName
-     *
-     * @param array $tca Incoming TCA
-     * @return array Migrated TCA
-     */
-    protected function migrateShowItemAdditionalPaletteToOwnPalette(array $tca): array
-    {
-        $newTca = $tca;
-        foreach ($tca as $table => $tableDefinition) {
-            if (!isset($tableDefinition['types']) || !is_array($tableDefinition['types'])) {
-                continue;
-            }
-            foreach ($tableDefinition['types'] as $typeName => $typeArray) {
-                if (
-                    !isset($typeArray['showitem'])
-                    || !is_string($typeArray['showitem'])
-                    || strpos($typeArray['showitem'], ';') === false // no field parameters
-                ) {
-                    continue;
-                }
-                $itemList = GeneralUtility::trimExplode(',', $typeArray['showitem'], true);
-                $newFieldStrings = [];
-                foreach ($itemList as $fieldString) {
-                    $fieldArray = GeneralUtility::trimExplode(';', $fieldString);
-                    $fieldArray = [
-                        'fieldName' => $fieldArray[0] ?? '',
-                        'fieldLabel' => $fieldArray[1] ?? null,
-                        'paletteName' => $fieldArray[2] ?? null,
-                    ];
-                    if ($fieldArray['fieldName'] !== '--palette--' && $fieldArray['paletteName'] !== null) {
-                        if ($fieldArray['fieldLabel']) {
-                            $fieldString = $fieldArray['fieldName'] . ';' . $fieldArray['fieldLabel'];
-                        } else {
-                            $fieldString = $fieldArray['fieldName'];
-                        }
-                        $paletteString = '--palette--;;' . $fieldArray['paletteName'];
-                        $this->messages[] = 'Migrated \'showitem\' field from TCA table '
-                            . $table . '[\'types\'][\'' . $typeName . '\']" : Moved additional palette'
-                            . ' with name "' . $table . '[\'types\'][\'' . $typeName . '\'][\'' . $fieldArray['paletteName'] . '\']" as 3rd argument of field "'
-                            . $table . '[\'types\'][\'' . $typeName . '\'][\'' . $fieldArray['fieldName'] . '\']"'
-                            . 'to an own palette. The result of this part is: "' . $fieldString . ', ' . $paletteString . '"';
-                        $newFieldStrings[] = $fieldString;
-                        $newFieldStrings[] = $paletteString;
-                    } else {
-                        $newFieldStrings[] = $fieldString;
-                    }
-                }
-                $newTca[$table]['types'][$typeName]['showitem'] = implode(',', $newFieldStrings);
-            }
-        }
-        return $newTca;
-    }
-
-    /**
-     * Migrate core icons for form field wizard to new location
-     *
-     * @param array $tca Incoming TCA
-     * @return array Migrated TCA
-     */
-    protected function migrateIconsForFormFieldWizardToNewLocation(array $tca): array
-    {
-        $newTca = $tca;
-
-        $newFileLocations = [
-            'add.gif' => 'actions-add',
-            'link_popup.gif' => 'actions-wizard-link',
-            'wizard_rte2.gif' => 'actions-wizard-rte',
-            'wizard_table.gif' => 'content-table',
-            'edit2.gif' => 'actions-open',
-            'list.gif' => 'actions-system-list-open',
-            'wizard_forms.gif' => 'EXT:backend/Resources/Public/Images/FormFieldWizard/wizard_forms.gif',
-            'EXT:backend/Resources/Public/Images/FormFieldWizard/wizard_add.gif' => 'actions-add',
-            'EXT:backend/Resources/Public/Images/FormFieldWizard/wizard_table.gif' => 'content-table',
-            'EXT:backend/Resources/Public/Images/FormFieldWizard/wizard_edit.gif' => 'actions-open',
-            'EXT:backend/Resources/Public/Images/FormFieldWizard/wizard_list.gif' => 'actions-system-list-open',
-            'EXT:backend/Resources/Public/Images/FormFieldWizard/wizard_link.gif' => 'actions-wizard-link',
-            'EXT:backend/Resources/Public/Images/FormFieldWizard/wizard_rte.gif' => 'actions-wizard-rte'
-        ];
-        $oldFileNames = array_keys($newFileLocations);
-
-        foreach ($tca as $table => $tableDefinition) {
-            if (!isset($tableDefinition['columns']) || !is_array($tableDefinition['columns'])) {
-                continue;
-            }
-            foreach ($tableDefinition['columns'] as $fieldName => $fieldConfig) {
-                if (
-                    isset($fieldConfig['config']['wizards'])
-                    && is_array($fieldConfig['config']['wizards']) // and there are wizards
-                ) {
-                    foreach ($fieldConfig['config']['wizards'] as $wizardName => $wizardConfig) {
-                        if (!is_array($wizardConfig)) {
-                            continue;
-                        }
-
-                        foreach ($wizardConfig as $option => $value) {
-                            if ($option === 'icon' && in_array($value, $oldFileNames, true)) {
-                                $newTca[$table]['columns'][$fieldName]['config']['wizards'][$wizardName]['icon'] = $newFileLocations[$value];
-                                $this->messages[] = 'The icon path of wizard "' . $wizardName
-                                    . '" from TCA table "'
-                                    . $table . '[\'columns\'][\'' . $fieldName . '\'][\'config\'][\'wizards\'][\'' . $wizardName . '\'][\'icon\']"'
-                                    . 'has been migrated to '
-                                    . $table . '[\'columns\'][\'' . $fieldName . '\'][\'config\'][\'wizards\'][\'' . $wizardName . '\'][\'icon\']" = \'' . $newFileLocations[$value] . '\'.';
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-        return $newTca;
-    }
-
-    /**
-     * Migrate file reference which starts with ext/ or sysext/ to EXT:
-     *
-     * @param array $tca Incoming TCA
-     * @return array Migrated TCA
-     */
-    protected function migrateExtAndSysextPathToEXTPath(array $tca): array
-    {
-        foreach ($tca as $table => &$tableDefinition) {
-            if (!isset($tableDefinition['columns']) || !is_array($tableDefinition['columns'])) {
-                continue;
-            }
-            foreach ($tableDefinition['columns'] as $fieldName => &$fieldConfig) {
-                if (
-                    !empty($fieldConfig['config']['type']) // type is set
-                    && trim($fieldConfig['config']['type']) === 'select' // to "select"
-                    && isset($fieldConfig['config']['items'])
-                    && is_array($fieldConfig['config']['items']) // and there are items
-                ) {
-                    foreach ($fieldConfig['config']['items'] as &$itemConfig) {
-                        // more then two values? then the third entry is the image path
-                        if (!empty($itemConfig[2])) {
-                            $tcaPath = implode('.', [$table, 'columns', $fieldName, 'config', 'items']);
-                            $pathParts = GeneralUtility::trimExplode('/', $itemConfig[2]);
-                            // remove first element (ext or sysext)
-                            array_shift($pathParts);
-                            $path = implode('/', $pathParts);
-                            // If the path starts with ext/ or sysext/ migrate it
-                            if (
-                                strpos($itemConfig[2], 'ext/') === 0
-                                || strpos($itemConfig[2], 'sysext/') === 0
-                            ) {
-                                $this->messages[] = '[' . $tcaPath . '] ext/ or sysext/ within the path (' . $path . ') in items array is deprecated, use EXT: reference';
-                                $itemConfig[2] = 'EXT:' . $path;
-                            } elseif (strpos($itemConfig[2], 'i/') === 0) {
-                                $this->messages[] = '[' . $tcaPath . '] i/ within the path (' . $path . ') in items array is deprecated, use EXT: reference';
-                                $itemConfig[2] = 'EXT:backend/Resources/Public/Images/' . substr($itemConfig[2], 2);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        return $tca;
-    }
-
-    /**
-     * Migrate "iconsInOptionTags" for "select" TCA fields
-     *
-     * @param array $tca Incoming TCA
-     * @return array Migrated TCA
-     */
-    protected function migrateIconsInOptionTags(array $tca): array
-    {
-        $newTca = $tca;
-
-        foreach ($newTca as $table => &$tableDefinition) {
-            if (!isset($tableDefinition['columns']) || !is_array($tableDefinition['columns'])) {
-                continue;
-            }
-            foreach ($tableDefinition['columns'] as $fieldName => &$fieldConfig) {
-                if (isset($fieldConfig['config']['iconsInOptionTags'])) {
-                    unset($fieldConfig['config']['iconsInOptionTags']);
-                    $this->messages[] = 'Configuration option \'iconsInOptionTags\' was removed from field "' . $fieldName . '" in TCA table "' . $table . '[\'config\']"';
-                }
-            }
-        }
-
-        return $newTca;
-    }
-
-    /**
-     * Migrate "iconfile" references which starts with ../ to EXT: and consisting of filename only to absolute paths in EXT:t3skin
-     *
-     * @param array $tca Incoming TCA
-     * @return array Migrated TCA
-     */
-    protected function migrateIconfileRelativePathOrFilenameOnlyToExtReference(array $tca): array
-    {
-        foreach ($tca as $table => &$tableDefinition) {
-            if (!isset($tableDefinition['ctrl']) || !is_array($tableDefinition['ctrl'])) {
-                continue;
-            }
-            if (!isset($tableDefinition['ctrl']['iconfile'])) {
-                continue;
-            }
-            if (strpos($tableDefinition['ctrl']['iconfile'], '../typo3conf/ext/') === 0) {
-                $tableDefinition['ctrl']['iconfile'] = str_replace('../typo3conf/ext/', 'EXT:', $tableDefinition['ctrl']['iconfile']);
-                $tcaPath = implode('.', [$table, 'ctrl', 'iconfile']);
-                $this->messages[] = '[' . $tcaPath . '] relative path to ../typo3conf/ext/ is deprecated, use EXT: instead';
-            } elseif (strpos($tableDefinition['ctrl']['iconfile'], '/') === false) {
-                $tableDefinition['ctrl']['iconfile'] = 'EXT:backend/Resources/Public/Images/' . $tableDefinition['ctrl']['iconfile'];
-                $tcaPath = implode('.', [$table, 'ctrl', 'iconfile']);
-                $this->messages[] = '[' . $tcaPath . '] filename only is deprecated, use EXT: or absolute reference instead';
-            }
-        }
-        return $tca;
-    }
-
-    /**
-     * Migrate "type=select" with "renderMode=[tree|singlebox|checkbox]" to "renderType=[selectTree|selectSingleBox|selectCheckBox]".
-     * This migration also take care of "maxitems" settings and set "renderType=[selectSingle|selectMultipleSideBySide]" if no other
-     * renderType is already set.
-     *
-     * @param array $tca
-     * @return array
-     */
-    public function migrateSelectFieldRenderType(array $tca): array
-    {
-        $newTca = $tca;
-
-        foreach ($newTca as $table => &$tableDefinition) {
-            if (empty($tableDefinition['columns'])) {
-                continue;
-            }
-
-            foreach ($tableDefinition['columns'] as $columnName => &$columnDefinition) {
-                // Only handle select fields.
-                if (empty($columnDefinition['config']['type']) || $columnDefinition['config']['type'] !== 'select') {
-                    continue;
-                }
-                // Do not handle field where the render type is set.
-                if (!empty($columnDefinition['config']['renderType'])) {
-                    continue;
-                }
-
-                $tableColumnInfo = 'table "' . $table . '[\'columns\'][\'' . $columnName . '\']"';
-                $this->messages[] = 'Using the \'type\' = \'select\' field in "' . $table . '[\'columns\'][\'' . $columnName . '\'][\'config\'][\'type\'] = \'select\'" without the "renderType" setting in "'
-                    . $table . '[\'columns\'][\'' . $columnName . '\'][\'config\'][\'renderType\']" is deprecated.';
-
-                $columnConfig = &$columnDefinition['config'];
-                if (!empty($columnConfig['renderMode'])) {
-                    $this->messages[] = 'The "renderMode" setting for select fields is deprecated. Please use "renderType" instead in ' . $tableColumnInfo;
-                    switch ($columnConfig['renderMode']) {
-                        case 'tree':
-                            $columnConfig['renderType'] = 'selectTree';
-                            break;
-                        case 'singlebox':
-                            $columnConfig['renderType'] = 'selectSingleBox';
-                            break;
-                        case 'checkbox':
-                            $columnConfig['renderType'] = 'selectCheckBox';
-                            break;
-                        default:
-                            $this->messages[] = 'The render mode ' . $columnConfig['renderMode'] . ' is invalid for the select field in ' . $tableColumnInfo;
-                    }
-                    continue;
-                }
-
-                $maxItems = !empty($columnConfig['maxitems']) ? (int)$columnConfig['maxitems'] : 1;
-                if ($maxItems <= 1) {
-                    $columnConfig['renderType'] = 'selectSingle';
-                } else {
-                    $columnConfig['renderType'] = 'selectMultipleSideBySide';
-                }
-            }
-        }
-
-        return $newTca;
-    }
-
-    /**
-     * Migrate the visibility of the icon table for fields with "renderType=selectSingle"
-     *
-     * @param array $tca
-     * @return array Migrated TCA
-     */
-    public function migrateSelectFieldIconTable(array $tca): array
-    {
-        foreach ($tca as $table => &$tableDefinition) {
-            if (!isset($tableDefinition['columns']) || !is_array($tableDefinition['columns'])) {
-                continue;
-            }
-            foreach ($tableDefinition['columns'] as $fieldName => &$fieldConfig) {
-                if (empty($fieldConfig['config']['renderType']) || $fieldConfig['config']['renderType'] !== 'selectSingle') {
-                    continue;
-                }
-                if (array_key_exists('noIconsBelowSelect', $fieldConfig['config'])) {
-                    $this->messages[] = 'The "noIconsBelowSelect" setting for select fields in table "'
-                        . $table . '[\'columns\'][\'' . $fieldName . '\'][\'config\']" was removed. Please define the setting "showIconTable" in table "'
-                        . $table . '[\'columns\'][\'' . $fieldName . '\'][\'config\'][\'showIconTable\']"';
-                    if (!$fieldConfig['config']['noIconsBelowSelect']) {
-                        // If old setting was explicitly false, enable icon table if not defined yet
-                        if (!array_key_exists('showIconTable', $fieldConfig['config'])) {
-                            $fieldConfig['config']['showIconTable'] = true;
-                        }
-                    }
-                    unset($fieldConfig['config']['noIconsBelowSelect']);
-                }
-                if (array_key_exists('suppress_icons', $fieldConfig['config'])) {
-                    $this->messages[] = 'The "suppress_icons" setting for select fields in table "'
-                        . $table . '[\'columns\'][\'' . $fieldName . '\'][\'config\']" was removed. Please define the setting "showIconTable" for table "'
-                        . $table . '[\'columns\'][\'' . $fieldName . '\'][\'config\'][\'showIconTable\']"';
-                    unset($fieldConfig['config']['suppress_icons']);
-                }
-                if (array_key_exists('foreign_table_loadIcons', $fieldConfig['config'])) {
-                    $this->messages[] = 'The "foreign_table_loadIcons" setting for select fields in table "'
-                        . $table . '[\'columns\'][\'' . $fieldName . '\'][\'config\']" was removed. Please define the setting "showIconTable" for table "'
-                        . $table . '[\'columns\'][\'' . $fieldName . '\'][\'config\'][\'showIconTable\']"';
-                    unset($fieldConfig['config']['foreign_table_loadIcons']);
-                }
-            }
-        }
-        return $tca;
-    }
-
-    /**
-     * Migrate wizard "wizard_element_browser" used in mode "wizard" to use the "wizard_link" instead
-     *
-     * @param array $tca
-     * @return array Migrated TCA
-     */
-    protected function migrateElementBrowserWizardToLinkHandler(array $tca): array
-    {
-        foreach ($tca as $table => &$tableDefinition) {
-            if (!isset($tableDefinition['columns']) || !is_array($tableDefinition['columns'])) {
-                continue;
-            }
-            foreach ($tableDefinition['columns'] as $fieldName => &$fieldConfig) {
-                if (
-                    isset($fieldConfig['config']['wizards']['link']['module']['name']) && $fieldConfig['config']['wizards']['link']['module']['name'] === 'wizard_element_browser'
-                    && isset($fieldConfig['config']['wizards']['link']['module']['urlParameters']['mode']) && $fieldConfig['config']['wizards']['link']['module']['urlParameters']['mode'] === 'wizard'
-                ) {
-                    $fieldConfig['config']['wizards']['link']['module']['name'] = 'wizard_link';
-                    unset($fieldConfig['config']['wizards']['link']['module']['urlParameters']['mode']);
-                    if (empty($fieldConfig['config']['wizards']['link']['module']['urlParameters'])) {
-                        unset($fieldConfig['config']['wizards']['link']['module']['urlParameters']);
-                    }
-                    $this->messages[] = 'Reference to "wizard_element_browser" was migrated from "'
-                        . $table . '[\'columns\'][\'' . $fieldName . '\'][\'config\'][\'wizards\'][\'link\'][\'module\'][\'name\'] === \'wizard_element_browser\'"'
-                        . ' to new "wizard_link", "'
-                        . $table . '[\'columns\'][\'' . $fieldName . '\'][\'config\'][\'wizards\'][\'link\'][\'module\'][\'name\'] = \'wizard_link\'"';
-                }
-            }
-        }
-        return $tca;
-    }
-
-    /**
      * Migrate defaultExtras "richtext:rte_transform[mode=ts_css]" and similar stuff like
      * "richtext:rte_transform[mode=ts_css]" to "richtext:rte_transform"
      *
@@ -2394,7 +1802,7 @@ class TcaMigration
      * @param array $tca
      * @return array
      */
-    protected function migrateinputDateTimeMax(array $tca): array
+    protected function migrateInputDateTimeMax(array $tca): array
     {
         foreach ($tca as $table => &$tableDefinition) {
             if (isset($tableDefinition['columns']) && is_array($tableDefinition['columns'])) {
index 5397cb0..9e361bf 100644 (file)
@@ -1008,6 +1008,7 @@ The following features have been removed:
 * `eID` script targets cannot define a script path anymore:
   `$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['my_eID'] = 'EXT:benni/Scripts/download.php'` will not work anymore.
   Instead, they must contain a target (callable, class/method, function).
+* TCA auto migration from core v6 to core v7 compatible TCA
 
 
 The following database tables have been removed:
@@ -1033,6 +1034,7 @@ The following php doc annotations have been removed:
 * `@transient`
 * `@validate`
 
+
 Impact
 ======
 
index b0236ba..eaba40f 100644 (file)
@@ -141,278 +141,6 @@ class TcaMigrationTest extends UnitTestCase
     /**
      * @test
      */
-    public function migrateChangesT3editorWizardToT3editorRenderTypeIfNotEnabledByTypeConfig(): void
-    {
-        $input = [
-            'aTable' => [
-                'columns' => [
-                    'bodytext' => [
-                        'exclude' => true,
-                        'label' => 'aLabel',
-                        'config' => [
-                            'type' => 'text',
-                            'rows' => 42,
-                            'wizards' => [
-                                't3editor' => [
-                                    'type' => 'userFunc',
-                                    'userFunc' => 'TYPO3\CMS\T3editor\FormWizard->main',
-                                    'title' => 't3editor',
-                                    'icon' => 'content-table',
-                                    'module' => [
-                                        'name' => 'wizard_table'
-                                    ],
-                                    'params' => [
-                                        'format' => 'html',
-                                        'style' => 'width:98%; height: 60%;'
-                                    ],
-                                ],
-                            ],
-                        ],
-                    ],
-                ],
-            ],
-        ];
-        $expected = [
-            'aTable' => [
-                'columns' => [
-                    'bodytext' => [
-                        'exclude' => true,
-                        'label' => 'aLabel',
-                        'config' => [
-                            'type' => 'text',
-                            'renderType' => 't3editor',
-                            'format' => 'html',
-                            'rows' => 42,
-                        ],
-                    ],
-                ],
-            ],
-        ];
-        $subject = new TcaMigration();
-        $this->assertEquals($expected, $subject->migrate($input));
-    }
-
-    /**
-     * @test
-     */
-    public function migrateDropsStylePointerFromShowItem(): void
-    {
-        $input = [
-            'aTable' => [
-                'types' => [
-                    0 => [
-                        'showitem' => 'aField,anotherField;with;;;style-pointer,thirdField',
-                    ],
-                    1 => [
-                        'showitem' => 'aField,;;;;only-a-style-pointer,anotherField',
-                    ],
-                ],
-            ],
-        ];
-        $expected = [
-            'aTable' => [
-                'types' => [
-                    0 => [
-                        'showitem' => 'aField,anotherField;with,thirdField',
-                    ],
-                    1 => [
-                        'showitem' => 'aField,anotherField',
-                    ],
-                ],
-            ],
-        ];
-        $subject = new TcaMigration();
-        $this->assertEquals($expected, $subject->migrate($input));
-    }
-
-    /**
-     * @test
-     */
-    public function migrateMovesSpecialConfigurationToColumnsOverridesDefaultExtras(): void
-    {
-        $input = [
-            'aTable' => [
-                'types' => [
-                    0 => [
-                        'showitem' => 'aField,anotherField;with;;nowrap,thirdField',
-                    ],
-                ],
-            ],
-        ];
-        $expected = [
-            'aTable' => [
-                'types' => [
-                    0 => [
-                        'showitem' => 'aField,anotherField;with,thirdField',
-                        'columnsOverrides' => [
-                            'anotherField' => [
-                                'config' => [
-                                    'wrap' => 'off',
-                                ]
-                            ],
-                        ],
-                    ],
-                ],
-            ],
-        ];
-        $subject = new TcaMigration();
-        $this->assertEquals($expected, $subject->migrate($input));
-    }
-
-    /**
-     * @test
-     */
-    public function migrateMovesSpecialConfigurationToColumnsOverridesDefaultExtrasAndMergesExistingDefaultExtras(): void
-    {
-        $input = [
-            'aTable' => [
-                'columns' => [
-                    'anotherField' => [
-                        'defaultExtras' => 'nowrap',
-                        'config' => [
-                            'type' => 'text',
-                        ],
-                    ],
-                ],
-                'types' => [
-                    0 => [
-                        'showitem' => 'aField,anotherField;with;;enable-tab,thirdField',
-                    ],
-                ],
-            ],
-        ];
-        $expected = [
-            'aTable' => [
-                'columns' => [
-                    'anotherField' => [
-                        'config' => [
-                            'wrap' => 'off',
-                            'type' => 'text',
-                        ],
-                    ],
-                ],
-                'types' => [
-                    0 => [
-                        'showitem' => 'aField,anotherField;with,thirdField',
-                        'columnsOverrides' => [
-                            'anotherField' => [
-                                'config' => [
-                                    'wrap' => 'off',
-                                    'enableTabulator' => true,
-                                ],
-                            ],
-                        ],
-                    ],
-                ],
-            ],
-        ];
-        $subject = new TcaMigration();
-        $this->assertEquals($expected, $subject->migrate($input));
-    }
-
-    /**
-     * @test
-     */
-    public function migrateChangesT3editorWizardThatIsEnabledByTypeConfigToRenderTypeInColumnsOverrides(): void
-    {
-        $input = [
-            'aTable' => [
-                'columns' => [
-                    'bodytext' => [
-                        'exclude' => true,
-                        'label' => 'aLabel',
-                        'config' => [
-                            'type' => 'text',
-                            'rows' => 42,
-                            'wizards' => [
-                                't3editorHtml' => [
-                                    'type' => 'userFunc',
-                                    'userFunc' => 'TYPO3\CMS\T3editor\FormWizard->main',
-                                    'enableByTypeConfig' => 1,
-                                    'title' => 't3editor',
-                                    'icon' => 'content-table',
-                                    'module' => [
-                                        'name' => 'wizard_table'
-                                    ],
-                                    'params' => [
-                                        'format' => 'html',
-                                        'style' => 'width:98%; height: 60%;'
-                                    ],
-                                ],
-                                't3editorTypoScript' => [
-                                    'type' => 'userFunc',
-                                    'userFunc' => 'TYPO3\CMS\T3editor\FormWizard->main',
-                                    'enableByTypeConfig' => 1,
-                                    'title' => 't3editor',
-                                    'icon' => 'content-table',
-                                    'module' => [
-                                        'name' => 'wizard_table'
-                                    ],
-                                    'params' => [
-                                        'format' => 'typoscript',
-                                        'style' => 'width:98%; height: 60%;'
-                                    ],
-                                ],
-                            ],
-                        ],
-                    ],
-                ],
-                'types' => [
-                    'firstType' => [
-                        'showitem' => 'foo,bodytext;;;wizards[t3editorTypoScript|someOtherWizard],bar',
-                    ],
-                    'secondType' => [
-                        'showitem' => 'foo,bodytext;;;nowrap:wizards[t3editorHtml], bar',
-                    ],
-                ],
-            ],
-        ];
-        $expected = [
-            'aTable' => [
-                'columns' => [
-                    'bodytext' => [
-                        'exclude' => true,
-                        'label' => 'aLabel',
-                        'config' => [
-                            'type' => 'text',
-                            'rows' => 42,
-                        ],
-                    ],
-                ],
-                'types' => [
-                    'firstType' => [
-                        'showitem' => 'foo,bodytext,bar',
-                        'columnsOverrides' => [
-                            'bodytext' => [
-                                'config' => [
-                                    'format' => 'typoscript',
-                                    'renderType' => 't3editor',
-                                ],
-                            ],
-                        ],
-                    ],
-                    'secondType' => [
-                        'showitem' => 'foo,bodytext,bar',
-                        'columnsOverrides' => [
-                            'bodytext' => [
-                                'config' => [
-                                    'format' => 'html',
-                                    'renderType' => 't3editor',
-                                    'wrap' => 'off',
-                                ],
-                            ],
-                        ],
-                    ],
-                ],
-            ],
-        ];
-        $subject = new TcaMigration();
-        $this->assertEquals($expected, $subject->migrate($input));
-    }
-
-    /**
-     * @test
-     */
     public function migrateRemovesAnUnusedT3edtiorDefinitionIfEnabledByTypeConfig(): void
     {
         $input = [
@@ -493,631 +221,27 @@ class TcaMigrationTest extends UnitTestCase
     /**
      * @test
      */
-    public function migrateShowItemMovesAdditionalPaletteToOwnPaletteDefinition(): void
+    public function migrateKeepsGivenExtensionReference(): void
     {
         $input = [
-            'aTable' => [
-                'types' => [
-                    'firstType' => [
-                        'showitem' => 'field1;field1Label,field2;fieldLabel2;palette1,field2;;palette2',
-                    ],
+                'aTable' => [
+                        'ctrl' => [
+                                'iconfile' => 'EXT:myExt/iconfile.gif',
+                        ],
                 ],
-            ],
         ];
         $expected = [
-            'aTable' => [
-                'types' => [
-                    'firstType' => [
-                        'showitem' => 'field1;field1Label,field2;fieldLabel2,--palette--;;palette1,field2,--palette--;;palette2',
-                    ],
+                'aTable' => [
+                        'ctrl' => [
+                                'iconfile' => 'EXT:myExt/iconfile.gif',
+                        ],
                 ],
-            ],
         ];
         $subject = new TcaMigration();
         $this->assertEquals($expected, $subject->migrate($input));
     }
 
     /**
-     * @test
-     */
-    public function migrateIconsForFormFieldWizardToNewLocation(): void
-    {
-        $input = [
-            'aTable' => [
-                'columns' => [
-                    'bodytext' => [
-                        'config' => [
-                            'type' => 'text',
-                            'wizards' => [
-                                't3editorHtml' => [
-                                    'icon' => 'wizard_table.gif',
-                                ],
-                            ],
-                        ],
-                    ],
-                ],
-            ],
-        ];
-
-        $expected = [
-            'aTable' => [
-                'columns' => [
-                    'bodytext' => [
-                        'config' => [
-                            'type' => 'text',
-                            'wizards' => [
-                                't3editorHtml' => [
-                                    'icon' => 'content-table',
-                                ],
-                            ],
-                        ],
-                    ],
-                ],
-            ],
-        ];
-
-        $subject = new TcaMigration();
-        $this->assertEquals($expected, $subject->migrate($input));
-    }
-
-    /**
-     * @test
-     */
-    public function migrateExtAndSysextPathToEXTPath(): void
-    {
-        $input = [
-            'aTable' => [
-                'columns' => [
-                    'foo' => [
-                        'config' => [
-                            'type' => 'select',
-                            'items' => [
-                                ['foo', 0, 'ext/myext/foo/bar.gif'],
-                                ['bar', 1, 'sysext/myext/foo/bar.gif'],
-                            ],
-                        ],
-                    ],
-                ],
-            ],
-        ];
-
-        $expected = [
-            'aTable' => [
-                'columns' => [
-                    'foo' => [
-                        'config' => [
-                            'type' => 'select',
-                            'renderType' => 'selectSingle',
-                            'items' => [
-                                ['foo', 0, 'EXT:myext/foo/bar.gif'],
-                                ['bar', 1, 'EXT:myext/foo/bar.gif'],
-                            ],
-                        ],
-                    ],
-                ],
-            ],
-        ];
-
-        $subject = new TcaMigration();
-        $this->assertEquals($expected, $subject->migrate($input));
-    }
-
-    /**
-     * @test
-     */
-    public function migratePathWhichStartsWithIToEXTPath(): void
-    {
-        $input = [
-            'aTable' => [
-                'columns' => [
-                    'foo' => [
-                        'config' => [
-                            'type' => 'select',
-                            'items' => [
-                                ['foo', 0, 'i/tt_content.gif'],
-                            ],
-                        ],
-                    ],
-                ],
-            ],
-        ];
-
-        $expected = [
-            'aTable' => [
-                'columns' => [
-                    'foo' => [
-                        'config' => [
-                            'type' => 'select',
-                            'renderType' => 'selectSingle',
-                            'items' => [
-                                ['foo', 0, 'EXT:backend/Resources/Public/Images/tt_content.gif'],
-                            ],
-                        ],
-                    ],
-                ],
-            ],
-        ];
-
-        $subject = new TcaMigration();
-        $this->assertEquals($expected, $subject->migrate($input));
-    }
-
-    /**
-     * @test
-     */
-    public function migrateRemovesIconsInOptionTags(): void
-    {
-        $input = [
-            'aTable' => [
-                'columns' => [
-                    'foo' => [
-                        'config' => [
-                            'type' => 'select',
-                            'iconsInOptionTags' => 1,
-                        ],
-                    ],
-                ],
-            ],
-        ];
-        $expected = [
-            'aTable' => [
-                'columns' => [
-                    'foo' => [
-                        'config' => [
-                            'type' => 'select',
-                            'renderType' => 'selectSingle',
-                        ],
-                    ],
-                ],
-            ],
-        ];
-
-        $subject = new TcaMigration();
-        $this->assertEquals($expected, $subject->migrate($input));
-    }
-
-    /**
-     * @test
-     */
-    public function migrateRewritesRelativeIconPathToExtensionReference(): void
-    {
-        $input = [
-                'aTable' => [
-                        'ctrl' => [
-                                'iconfile' => '../typo3conf/ext/myExt/iconfile.gif',
-                        ],
-                ],
-        ];
-        $expected = [
-                'aTable' => [
-                        'ctrl' => [
-                                'iconfile' => 'EXT:myExt/iconfile.gif',
-                        ],
-                ],
-        ];
-        $subject = new TcaMigration();
-        $this->assertEquals($expected, $subject->migrate($input));
-    }
-
-    /**
-     * @test
-     */
-    public function migrateRewritesIconFilenameOnlyToDefaultT3skinExtensionReference(): void
-    {
-        $input = [
-                'aTable' => [
-                        'ctrl' => [
-                                'iconfile' => 'iconfile.gif',
-                        ],
-                ],
-        ];
-        $expected = [
-                'aTable' => [
-                        'ctrl' => [
-                                'iconfile' => 'EXT:backend/Resources/Public/Images/iconfile.gif',
-                        ],
-                ],
-        ];
-        $subject = new TcaMigration();
-        $this->assertEquals($expected, $subject->migrate($input));
-    }
-
-    /**
-     * @test
-     */
-    public function migrateKeepsGivenExtensionReference(): void
-    {
-        $input = [
-                'aTable' => [
-                        'ctrl' => [
-                                'iconfile' => 'EXT:myExt/iconfile.gif',
-                        ],
-                ],
-        ];
-        $expected = [
-                'aTable' => [
-                        'ctrl' => [
-                                'iconfile' => 'EXT:myExt/iconfile.gif',
-                        ],
-                ],
-        ];
-        $subject = new TcaMigration();
-        $this->assertEquals($expected, $subject->migrate($input));
-    }
-
-    /**
-     * @test
-     */
-    public function migrateSelectFieldRenderType(): void
-    {
-        $input = [
-            'aTable-do-not-migrate-because-renderType-is-set' => [
-                'columns' => [
-                    'a-column' => [
-                        'config' => [
-                            'type' => 'select',
-                            'renderType' => 'fooBar'
-                        ]
-                    ]
-                ],
-            ],
-            'aTable-do-migrate-because-renderType-is-not-set' => [
-                'columns' => [
-                    'a-tree-column' => [
-                        'config' => [
-                            'type' => 'select',
-                            'renderMode' => 'tree'
-                        ]
-                    ],
-                    'a-singlebox-column' => [
-                        'config' => [
-                            'type' => 'select',
-                            'renderMode' => 'singlebox'
-                        ]
-                    ],
-                    'a-checkbox-column' => [
-                        'config' => [
-                            'type' => 'select',
-                            'renderMode' => 'checkbox'
-                        ]
-                    ],
-                    'an-unknown-column' => [
-                        'config' => [
-                            'type' => 'select',
-                            'renderMode' => 'unknown'
-                        ]
-                    ],
-                    'a-maxitems-column-not-set' => [
-                        'config' => [
-                            'type' => 'select',
-                        ]
-                    ],
-                    'a-maxitems-column-0' => [
-                        'config' => [
-                            'type' => 'select',
-                            'maxitems' => '0'
-                        ]
-                    ],
-                    'a-maxitems-column-1' => [
-                        'config' => [
-                            'type' => 'select',
-                            'maxitems' => '1'
-                        ]
-                    ],
-                    'a-maxitems-column-2' => [
-                        'config' => [
-                            'type' => 'select',
-                            'maxitems' => '2'
-                        ]
-                    ],
-                    'a-tree-column-with-maxitems' => [
-                        'config' => [
-                            'type' => 'select',
-                            'renderMode' => 'tree',
-                            'maxitems' => '1'
-                        ]
-                    ],
-                    'a-singlebox-column-with-maxitems' => [
-                        'config' => [
-                            'type' => 'select',
-                            'renderMode' => 'singlebox',
-                            'maxitems' => '1'
-                        ]
-                    ],
-                    'a-checkbox-column-with-maxitems' => [
-                        'config' => [
-                            'type' => 'select',
-                            'renderMode' => 'checkbox',
-                            'maxitems' => '1'
-                        ]
-                    ],
-                ],
-            ],
-        ];
-        $expected = [
-            'aTable-do-not-migrate-because-renderType-is-set' => [
-                'columns' => [
-                    'a-column' => [
-                        'config' => [
-                            'type' => 'select',
-                            'renderType' => 'fooBar'
-                        ]
-                    ]
-                ],
-            ],
-            'aTable-do-migrate-because-renderType-is-not-set' => [
-                'columns' => [
-                    'a-tree-column' => [
-                        'config' => [
-                            'type' => 'select',
-                            'renderMode' => 'tree',
-                            'renderType' => 'selectTree'
-                        ]
-                    ],
-                    'a-singlebox-column' => [
-                        'config' => [
-                            'type' => 'select',
-                            'renderMode' => 'singlebox',
-                            'renderType' => 'selectSingleBox'
-                        ]
-                    ],
-                    'a-checkbox-column' => [
-                        'config' => [
-                            'type' => 'select',
-                            'renderMode' => 'checkbox',
-                            'renderType' => 'selectCheckBox'
-                        ]
-                    ],
-                    'an-unknown-column' => [
-                        'config' => [
-                            'type' => 'select',
-                            'renderMode' => 'unknown'
-                        ]
-                    ],
-                    'a-maxitems-column-not-set' => [
-                        'config' => [
-                            'type' => 'select',
-                            'renderType' => 'selectSingle'
-                        ]
-                    ],
-                    'a-maxitems-column-0' => [
-                        'config' => [
-                            'type' => 'select',
-                            'maxitems' => '0',
-                            'renderType' => 'selectSingle'
-                        ]
-                    ],
-                    'a-maxitems-column-1' => [
-                        'config' => [
-                            'type' => 'select',
-                            'maxitems' => 1,
-                            'renderType' => 'selectSingle'
-                        ]
-                    ],
-                    'a-maxitems-column-2' => [
-                        'config' => [
-                            'type' => 'select',
-                            'maxitems' => 2,
-                            'renderType' => 'selectMultipleSideBySide'
-                        ]
-                    ],
-                    'a-tree-column-with-maxitems' => [
-                        'config' => [
-                            'type' => 'select',
-                            'renderMode' => 'tree',
-                            'renderType' => 'selectTree',
-                            'maxitems' => '1'
-                        ]
-                    ],
-                    'a-singlebox-column-with-maxitems' => [
-                        'config' => [
-                            'type' => 'select',
-                            'renderMode' => 'singlebox',
-                            'renderType' => 'selectSingleBox',
-                            'maxitems' => '1'
-                        ]
-                    ],
-                    'a-checkbox-column-with-maxitems' => [
-                        'config' => [
-                            'type' => 'select',
-                            'renderMode' => 'checkbox',
-                            'renderType' => 'selectCheckBox',
-                            'maxitems' => '1'
-                        ]
-                    ],
-                ],
-            ],
-        ];
-        $subject = new TcaMigration();
-        $this->assertEquals($expected, $subject->migrate($input));
-    }
-
-    /**
-     * @return array
-     */
-    public function migrateSetsShowIconTableIfMissingDataProvider(): array
-    {
-        return [
-            'not-a-select-is-kept' => [
-                [
-                    // Given config section
-                    'type' => 'input',
-                ],
-                [
-                    // Expected config section
-                    'type' => 'input',
-                ],
-            ],
-            'not-a-selectSingle-is-kept' => [
-                [
-                    'type' => 'select',
-                    'renderType' => 'selectCheckBox',
-                ],
-                [
-                    'type' => 'select',
-                    'renderType' => 'selectCheckBox',
-                ],
-            ],
-            'noIconsBelowSelect-true-is-removed' => [
-                [
-                    'type' => 'select',
-                    'renderType' => 'selectSingle',
-                    'noIconsBelowSelect' => true,
-                ],
-                [
-                    'type' => 'select',
-                    'renderType' => 'selectSingle',
-                ],
-            ],
-            'noIconsBelowSelect-false-is-removed-sets-field-wizard' => [
-                [
-                    'type' => 'select',
-                    'renderType' => 'selectSingle',
-                    'noIconsBelowSelect' => false,
-                ],
-                [
-                    'type' => 'select',
-                    'renderType' => 'selectSingle',
-                    'fieldWizard' => [
-                        'selectIcons' => [
-                            'disabled' => false,
-                        ],
-                    ],
-                ],
-            ],
-            'noIconsBelowSelect-false-is-removes-given-showIconTable-false' => [
-                [
-                    'type' => 'select',
-                    'renderType' => 'selectSingle',
-                    'noIconsBelowSelect' => false,
-                    'showIconTable' => false,
-                ],
-                [
-                    'type' => 'select',
-                    'renderType' => 'selectSingle',
-                ],
-            ],
-            'suppress-icons-1-is-removed' => [
-                [
-                    'type' => 'select',
-                    'renderType' => 'selectSingle',
-                    'suppress_icons' => '1',
-                ],
-                [
-                    'type' => 'select',
-                    'renderType' => 'selectSingle',
-                ],
-            ],
-            'suppress-icons-value-is-removed' => [
-                [
-                    'type' => 'select',
-                    'renderType' => 'selectSingle',
-                    'suppress_icons' => 'IF_VALUE_FALSE',
-                ],
-                [
-                    'type' => 'select',
-                    'renderType' => 'selectSingle',
-                ],
-            ],
-            'selicon-cols-is-removed' => [
-                [
-                    'type' => 'select',
-                    'renderType' => 'selectSingle',
-                    'selicon_cols' => 16,
-                ],
-                [
-                    'type' => 'select',
-                    'renderType' => 'selectSingle',
-                ],
-            ],
-            'foreign_table_loadIcons-is-removed' => [
-                [
-                    'type' => 'select',
-                    'renderType' => 'selectSingle',
-                    'foreign_table_loadIcons' => true,
-                ],
-                [
-                    'type' => 'select',
-                    'renderType' => 'selectSingle',
-                ],
-            ],
-        ];
-    }
-
-    /**
-     * @test
-     * @dataProvider migrateSetsShowIconTableIfMissingDataProvider
-     * @param array $givenConfig
-     * @param array $expectedConfig
-     */
-    public function migrateSetsShowIconTableIfMissing(array $givenConfig, array $expectedConfig): void
-    {
-        $input = [
-            'aTable' => [
-                'columns' => [
-                    'aField' => [
-                        'config' => $givenConfig,
-                    ]
-                ],
-            ],
-        ];
-        $expected = $input;
-        $expected['aTable']['columns']['aField']['config'] = $expectedConfig;
-
-        $subject = new TcaMigration();
-        $this->assertEquals($expected, $subject->migrate($input));
-    }
-
-    /**
-     * @test
-     */
-    public function migrateFixesReferenceToLinkHandler()
-    {
-        $input = [
-            'aTable' => [
-                'columns' => [
-                    'aCol' => [
-                        'config' => [
-                            'type' => 'input',
-                            'wizards' => [
-                                'link' => [
-                                    'module' => [
-                                        'name' => 'wizard_element_browser',
-                                        'urlParameters' => [
-                                            'mode' => 'wizard'
-                                        ]
-                                    ],
-                                ],
-                            ],
-                        ],
-                    ],
-                ],
-            ],
-        ];
-        $expected = [
-            'aTable' => [
-                'columns' => [
-                    'aCol' => [
-                        'config' => [
-                            'type' => 'input',
-                            'wizards' => [
-                                'link' => [
-                                    'module' => [
-                                        'name' => 'wizard_link',
-                                    ],
-                                ],
-                            ],
-                        ],
-                    ],
-                ],
-            ],
-        ];
-
-        $subject = new TcaMigration();
-        $this->assertEquals($expected, $subject->migrate($input));
-    }
-
-    /**
      * @return array
      */
     public function migrateRemovesRteTransformOptionsDataProvider(): array