Migration from subtypes to types

Migrate plugins with FlexForms added via subtypes_addlist

If you used plugins with the now deprecated subtypes, you probably used subtypes_addlist to display a FlexForm for configuration purposes.

Migrate by adding the field pi_flexform with the utility method ExtensionManagementUtility addToAllTCAtypes() instead. You also have to change the parameters used for method addPiFlexFormValue():

EXT:my_extension/Configuration/Overrides/tt_content.php
 $pluginSignature = ExtensionUtility::registerPlugin(
     'blog_example',
     'Pi1',
     'A Blog Example',
 );
-$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature]
-    = 'pi_flexform';

+ExtensionManagementUtility::addToAllTCAtypes(
+    'tt_content',
+    '--div--;Configuration,pi_flexform,pages,recursive,',
+    $pluginSignature,
+    'after:subheader',
+);
 ExtensionManagementUtility::addPiFlexFormValue(
-    $pluginSignature,
+    '*',
     'FILE:EXT:blog_example/Configuration/FlexForms/PluginSettings.xml',
+    $pluginSignature,
 );
Copied!

The fields pages and recursive used to be added automatically to plugins when using the now outdated subtype "list_type". Therefore they have to be added manually when doing the migration.

Migrate plugins with fields removed via subtypes_excludelist

Many extension author used the now deprecated option subtypes_excludelist to hide these automatically added fields.

The same effect can now be used by simply not adding the fields in the first place:

EXT:my_extension/Configuration/Overrides/tt_content.php
 $pluginSignature = ExtensionUtility::registerPlugin(
     'blog_example',
     'Pi1',
     'A Blog Example',
 );
-$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist'][$pluginSignature]
-    = 'pages,recursive';
Copied!

If any other fields have been removed with this method you can only remove them by overriding $GLOBALS['TCA']['tt_content']['types'][$pluginSignature]['showitem'] or via page TSconfig.

Migrate custom tables using subtypes

Replace any subtype_value_field configuration with dedicated record types. Please also consider migrating corresponding subtypes_addlist and subtypes_excludelist definitions accordingly.

EXT:my_extension/Configuration/TCA/tx_myextension_mytable.php
 $pluginSignature = ExtensionUtility::registerPlugin(
     'blog_example',
     'Pi1',
     'A Blog Example',
 );
-$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist'][$pluginSignature]
-    = 'pages,recursive';
Copied!

Migration: PreviewRenderer for subtypes

When migrating a plugin with a PreviewRenderer from list_type registration to its own CType change the PreviewRenderer configuration to the record type as well:

EXT:my_extension/Configuration/Overrides/tt_content.php
 $pluginSignature = ExtensionUtility::registerPlugin(
     'blog_example',
     'Pi1',
     'A Blog Example',
 );
-$GLOBALS['TCA']['tt_content']['types']['list_type']['previewRenderer'][$pluginSignature]
-        = \MyVendor\MyExtension\Preview\PreviewRenderer::class;
+$GLOBALS['TCA']['tt_content']['types'][$pluginSignature]['previewRenderer']
+        = \MyVendor\MyExtension\Preview\PreviewRenderer::class;
Copied!