From d01a03b032842fa6cf729235c1a0c50b53dadb68 Mon Sep 17 00:00:00 2001 From: linawolf <112@linawolf.de> Date: Fri, 4 Aug 2023 11:53:00 +0000 Subject: [PATCH] [DOCS] Correct Changelog for ExtensionUtility::configurePlugin The 5th parameter of ExtensionUtility::registerPlugin is thegroup and not `ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT` Fixes the name to the correct function and adds example code. Resolves: #101575 Releases: main, 12.4, 11.5 Change-Id: I05a344ee11aaa8a9b3187a11528e2e506f47756d Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80355 Tested-by: core-ci <typo3@b13.com> Tested-by: Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch> --- ...aultTypeDefinitionOfCustomContentTypes.rst | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/typo3/sysext/core/Documentation/Changelog/11.5.x/Important-98960-DefaultTypeDefinitionOfCustomContentTypes.rst b/typo3/sysext/core/Documentation/Changelog/11.5.x/Important-98960-DefaultTypeDefinitionOfCustomContentTypes.rst index e146be740f6e..814de880d033 100644 --- a/typo3/sysext/core/Documentation/Changelog/11.5.x/Important-98960-DefaultTypeDefinitionOfCustomContentTypes.rst +++ b/typo3/sysext/core/Documentation/Changelog/11.5.x/Important-98960-DefaultTypeDefinitionOfCustomContentTypes.rst @@ -13,7 +13,7 @@ Description Due to the deprecation of Switchable Controller Actions for Extbase, it is recommended to use custom content types as plugins. When using Extbase's API -:php:`\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin()` with +:php:`\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin()` with the 5th argument being set to :php:`\TYPO3\CMS\Extbase\Utility\ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT` or TYPO3's native API :php:`\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin()` @@ -39,7 +39,8 @@ Example Example for a custom Extbase plugin with TYPO3's Core "felogin" extension in `EXT:felogin/Configuration/TCA/Overrides/tt_content.php`: -.. code-block:: php +.. code-block:: php + :caption: EXT:felogin/Configuration/TCA/Overrides/tt_content.php call_user_func(static function () { $contentTypeName = 'felogin_login'; @@ -67,4 +68,27 @@ in `EXT:felogin/Configuration/TCA/Overrides/tt_content.php`: ); }); +It is configured to be a content element with its own ctype by having the 5th +parameter set to :php:`ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT`. + +.. code-block:: php + :caption: EXT:felogin/ext_localconf.php + :emphasize-lines: 14 + + use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; + + ExtensionUtility::configurePlugin( + 'Felogin', + 'Login', + [ + LoginController::class => 'login, overview', + PasswordRecoveryController::class => 'recovery,showChangePassword,changePassword', + ], + [ + LoginController::class => 'login, overview', + PasswordRecoveryController::class => 'recovery,showChangePassword,changePassword', + ], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT + ); + .. index:: Backend, TCA, ext:core -- GitLab