Deprecation: #107047 - ExtensionManagementUtility::addPiFlexFormValue()
See forge#107047
Description
The method
\TYPO3\
has been deprecated.
This method was historically used to assign FlexForm definitions to plugins
registered as subtypes in the
list_ field of
tt_. With
the removal of subtypes (see Breaking: #105377 - Deprecated functionality removed) and the shift
toward registering plugins as dedicated record types via CType, as well
as the removal of the ds_ and multi-entry ds array
format (see Breaking: #107047 - Remove pointer field functionality of TCA flex), this separate method call is no
longer necessary.
Impact
Calling this method will trigger a deprecation warning. The extension scanner will also report any usages. The method will be removed in TYPO3 v15.0.
Affected installations
Extensions that call
\TYPO3\
to assign FlexForm definitions to plugins or content elements are affected.
Migration
Instead of using this method, define the FlexForm configuration using one of the following approaches:
Option 1: Register via
registerPlugin()
Provide the FlexForm definition directly when registering the plugin. This has been possible since Feature: #107047 - FlexForm enhancements: Direct plugin registration and raw TCA support.
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
ExtensionUtility::registerPlugin(
'MyExtension',
'MyPlugin',
'My Plugin Title',
'my-extension-icon',
'plugins',
'Plugin description',
'FILE:EXT:my_extension/Configuration/FlexForm.xml'
);
Option 2: Register via
addPlugin() for non-Extbase plugins
This is also supported since Feature: #107047 - FlexForm enhancements: Direct plugin registration and raw TCA support.
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconRegistry;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\SelectItemUtility\SelectItem;
ExtensionManagementUtility::addPlugin(
new SelectItem(
'select',
'My Plugin Title',
'myextension_myplugin',
'my-extension-icon',
'plugins',
'Plugin description'
),
'FILE:EXT:my_extension/Configuration/FlexForm.xml'
);
Option 3: Define FlexForm via TCA
columnsOverrides
You can also directly define the FlexForm in TCA:
$GLOBALS['TCA']['tt_content']['types']['my_plugin']['columnsOverrides']
['pi_flexform']['config']['ds'] =
'FILE:EXT:my_extension/Configuration/FlexForm.xml';