-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
References: TYPO3-Documentation/Changelog-To-Doc#1073 Releases: main
- Loading branch information
Showing
16 changed files
with
239 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
Documentation/ColumnsConfig/Type/Flex/_CodeSnippets/_tt_content_plugin.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; | ||
use TYPO3\CMS\Extbase\Utility\ExtensionUtility; | ||
|
||
defined('TYPO3') or die(); | ||
|
||
$pluginKey = ExtensionUtility::registerPlugin( | ||
'blog_example', | ||
'BlogList', | ||
'List of Blogs (BlogExample)', | ||
'blog_example_icon', | ||
'plugins', | ||
'Display a list of blogs', | ||
); | ||
|
||
ExtensionManagementUtility::addToAllTCAtypes( | ||
'tt_content', | ||
'--div--;Configuration,pi_flexform', | ||
$pluginKey, | ||
'after:subheader', | ||
); | ||
|
||
ExtensionManagementUtility::addPiFlexFormValue( | ||
'*', | ||
'FILE:EXT:blog_example/Configuration/FlexForms/PluginSettings.xml', | ||
$pluginKey, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file removed
BIN
-43.1 KB
Documentation/Images/AutomaticScreenshots/PluginFlexFormConfigurationCheck.png
Binary file not shown.
6 changes: 0 additions & 6 deletions
6
Documentation/Images/Rst/PluginFlexFormConfigurationCheck.rst.txt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
:navigation-title: Subtype migration | ||
|
||
.. include:: /Includes.rst.txt | ||
|
||
.. _types-example-subtypes: | ||
.. _types-example-subtypes-remove: | ||
.. _types-example-subtypes-remove-types: | ||
.. _migration-subtype: | ||
|
||
================================ | ||
Migration from subtypes to types | ||
================================ | ||
|
||
.. contents:: Table of contents | ||
|
||
.. _migration-subtype-flexform: | ||
|
||
Migrate plugins with FlexForms added via `subtypes_addlist` | ||
=========================================================== | ||
|
||
If you used plugins with the now deprecated subtypes, you probably used | ||
:confval:`types-subtypes-addlist` to display a | ||
:ref:`FlexForm <t3coreapi:flexforms>` for configuration purposes. | ||
|
||
Migrate by adding the field :sql:`pi_flexform` with the utility method | ||
:php-short:`\TYPO3\CMS\Core\Utility\ExtensionManagementUtility` method | ||
`addToAllTCAtypes()` instead. You also have to change the parameters used for | ||
method `addPiFlexFormValue()`: | ||
|
||
.. literalinclude:: _CodeSnippets/_subtype_plugin_migration.diff | ||
:caption: EXT:my_extension/Configuration/Overrides/tt_content.php | ||
|
||
The fields :sql:`pages` and :sql:`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. | ||
|
||
.. _migration-subtype-subtypes-excludelist: | ||
|
||
Migrate plugins with fields removed via `subtypes_excludelist` | ||
============================================================== | ||
|
||
Many extension author used the now deprecated option | ||
:confval:`types-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: | ||
|
||
.. literalinclude:: _CodeSnippets/_subtype_plugin_exclude_migration.diff | ||
:caption: EXT:my_extension/Configuration/Overrides/tt_content.php | ||
|
||
If any other fields have been removed with this method you can only remove | ||
them by overriding | ||
:confval:`$GLOBALS['TCA']['tt_content']['types'][$pluginSignature]['showitems] <types-showitem>` | ||
or via page TSconfig. | ||
|
||
.. _migration-subtype-custom: | ||
|
||
Migrate custom tables using subtypes | ||
==================================== | ||
|
||
Replace any :confval:`types-subtype-value-field` configuration with dedicated record | ||
types. Please also consider migrating corresponding :confval:`types-subtypes-addlist` | ||
and :confval:`types-subtypes-excludelist` definitions accordingly. | ||
|
||
.. literalinclude:: _CodeSnippets/_subtype_plugin_exclude_migration.diff | ||
:caption: EXT:my_extension/Configuration/TCA/tx_myextension_mytable.php | ||
|
||
.. _types-example-previewRenderer-for-subtype: | ||
.. _migration-subtype-previewrenderer: | ||
|
||
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: | ||
|
||
.. literalinclude:: _CodeSnippets/_subtype_migration_preview.diff | ||
:caption: EXT:my_extension/Configuration/Overrides/tt_content.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
'ctrl' => [ | ||
'type' => 'type', | ||
], | ||
'columns' => [ | ||
'type' => [ | ||
'config' => [ | ||
'type' => 'select', | ||
'renderType' => 'selectSingle', | ||
'items' => [ | ||
[ | ||
'label' => 'A record type', | ||
'value' => 'a_record_type' | ||
], | ||
+ [ | ||
+ 'label' => 'A sub type', | ||
+ 'value' => 'a_sub_type' | ||
+ ], | ||
] | ||
] | ||
], | ||
- 'subtype' => [ | ||
- 'config' => [ | ||
- 'type' => 'select', | ||
- 'renderType' => 'selectSingle', | ||
- 'items' => [ | ||
- [ | ||
- 'label' => 'A sub type', | ||
- 'value' => 'a_sub_type' | ||
- ] | ||
- ] | ||
- ] | ||
- ], | ||
], | ||
'types' => [ | ||
'a_record_type' => [ | ||
'showitem' => 'aField,bField', | ||
- 'subtype_value_field' => 'subtype', | ||
- 'subtypes_addlist' => [ | ||
- 'a_sub_type' => 'pi_flexform' | ||
- ], | ||
- 'subtypes_excludelist' => [ | ||
- 'a_sub_type' => 'bField' | ||
- ], | ||
], | ||
+ 'a_sub_type' => [ | ||
+ 'showitem' => 'aField,pi_flexform' | ||
+ ] | ||
] |
9 changes: 9 additions & 0 deletions
9
Documentation/Types/_CodeSnippets/_subtype_migration_preview.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
$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; |
7 changes: 7 additions & 0 deletions
7
Documentation/Types/_CodeSnippets/_subtype_plugin_exclude_migration.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
$pluginSignature = ExtensionUtility::registerPlugin( | ||
'blog_example', | ||
'Pi1', | ||
'A Blog Example', | ||
); | ||
-$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist'][$pluginSignature] | ||
- = 'pages,recursive'; |
20 changes: 20 additions & 0 deletions
20
Documentation/Types/_CodeSnippets/_subtype_plugin_migration.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
$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, | ||
); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.