-
-
Notifications
You must be signed in to change notification settings - Fork 66
Description
Deprecation: #105076 - Plugin content element and plugin sub types
Deprecation: #105076 - Plugin content element and plugin sub types
See 105076
Description
Historically, plugins have been registered using the
list content element and the plugin
subtype list_type field. This
functionality has been kept for backwards compatibility reasons.
However, since the release of TYPO3 v12.4, the recommended way to create
a plugin is by using a dedicated content type
(CType) for each plugin.
This old "General Plugin" approach has always been ugly from a UX
perspective point of view since it hides plugin selection behind
"General plugin" content element, forcing a second selection step and
making such plugins something special.
Therefore, the plugin content element
(list) and the plugin sub types field
(list_type) have been marked as deprecated in TYPO3 v13.4 and will be
removed in TYPO3 v14.0.
Additionally, the related PHP constant
TYPO3\CMS\Extbase\Utility\ExtensionUtility::PLUGIN_TYPE_PLUGIN has
been deprecated as well.
Impact
Plugins added using
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin() where
the second parameter is list_type (which is still the default) will
trigger a deprecation level log entry in TYPO3 v13 and will fail in v14.
Therefore, the same applies on using
TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin() (to
configure the plugin for frontend rendering), where no fifth parameter
is provided or where the fifth parameter is list_type
(ExtensionUtility::PLUGIN_TYPE_PLUGIN), which is still the default.
Note
addPlugin() is also internally called when registering a plugin via
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPlugin().
In that case the plugin type to use is either the one defined via
TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin() or
also falls back to list_type.
Affected installations
Extensions registering plugins as
list_type plugin sub type.
Migration
Existing plugins must be migrated to use the
CType record type. Extension authors must
implement the following changes:
- Register plugins using the CType record
type - Create update wizard which extends
\TYPO3\CMS\Install\Updates\AbstractListTypeToCTypeUpdateand add
list_type to
CType mapping for each plugin to
migrate. The migration wizard for indexed_search in class
\TYPO3\CMS\Install\Updates\IndexedSearchCTypeMigrationcan be used
as reference example. - Migrate possible FlexForm registration and add dedicated
showitem TCA configuration - Migrate possible PreviewRenderer registration in TCA
- Adapt possible content element wizard items in Page TSConfig, where
list_type is used - Adapt possible content element restrictions in backend layouts or
container elements defined by third-party extensions like
ichhabrecht/content-defender.
Common example
// Before
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['my_plugin'] = 'pi_flexform';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['my_plugin'] = 'pages,layout,recursive';
// After
$GLOBALS['TCA']['tt_content']['types']['my_plugin']['showitem'] = '<Some Fields>,pi_flexform,<Other Fields>';Fluid, PHP-API, PartiallyScanned, ext:extbase