-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TASK] Deprecate plugin content element and plugin subtypes (list_type) #4821
base: main
Are you sure you want to change the base?
Conversation
345a537
to
9ae84d1
Compare
7e2a4ca
to
8e5da43
Compare
Depends on TYPO3-Documentation/TYPO3CMS-Reference-TCA#1183 Resolves: TYPO3-Documentation/Changelog-To-Doc#1071 Releases: main, 13.4
8e5da43
to
95ab966
Compare
Documentation/ApiOverview/ContentElements/ContentElementsWizard.rst
Outdated
Show resolved
Hide resolved
subtype. | ||
.. deprecated:: 13.4 | ||
Using the default `list_type` for the parameter is deprecated. All content | ||
elements and plugins should be added as sing `CType` for parameter `$type`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sing
? La la lala la laaaa string
? single
?
Documentation/ApiOverview/ContentElements/CustomBackendPreview.rst
Outdated
Show resolved
Hide resolved
Each plugin has its own plugin type, which is used in the database field | ||
tt_content.list_type. The list_type could be understood as subtype of CType. | ||
.. deprecated:: 13.4 | ||
Setting the second parameter to any value but `CType` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only list_type
is deprecated. You still can call that method without any deprecations for any TCA select type. Sure, it does not make sense, but it's possible. addPlugin
looks a little bit like addTcaSelectItem
, it just adds a new entry to a select type.
Documentation/ApiOverview/ContentElements/MigrationListType.rst
Outdated
Show resolved
Hide resolved
Documentation/ApiOverview/ContentElements/MigrationListType.rst
Outdated
Show resolved
Hide resolved
Documentation/ApiOverview/ContentElements/MigrationListType.rst
Outdated
Show resolved
Hide resolved
|
||
.. _plugins-list-type-migration-extbase-configuration: | ||
|
||
1. Adjust the Extbase plugin configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the fourth parameter, `$nonCacheableControllerActions` was missing you can | ||
set it to an empty array, the default value. | ||
|
||
It is theoretically possible that the extension author did not use this utility |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is correct for Extensions without Extbase usage, but for Extbase it is needed to register the action and controller here:
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions'][$extensionName]['plugins']
. And that entry will only be done by configurePlugin
. But yes, you also can register that part manually, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes and I have seen ppl do that. You cannot rely on they used the Utility functions. But "theoretically"
:caption: EXT:examples/Configuration/TCA/Overrides/tt_content.php (difference) | ||
|
||
The `CType` based plugin does not inherit the standard fields provided by the | ||
TCA of the content-element "List". These where in many cases removed by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nearly everywhere above you write it without -
TCA of the content-element "List". These where in many cases removed by | |
TCA of the content element "List". These where in many cases removed by |
------------------------------------------------------------- | ||
|
||
.. literalinclude:: _Migration/_tca_registration.php.diff | ||
:caption: EXT:examples/Configuration/TCA/Overrides/tt_content.php (difference) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are writing Line 15
below. So activating line numbers would be perfect
:caption: EXT:examples/Configuration/TCA/Overrides/tt_content.php (difference) | |
:caption: EXT:examples/Configuration/TCA/Overrides/tt_content.php (difference) | |
:linenos: |
|
||
As these fields are not displayed automatically anymore you can remove this | ||
definition without replacement: Line 15 in the diff. If they have not been | ||
removed and still needed you need to add them manually to your plugins type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed and still needed you need to add them manually to your plugins type. | |
removed and are still needed, you will need to manually add them to your plugin type. |
Migration example: Core-based plugin | ||
==================================== | ||
|
||
.. _plugins-list-type-migration-core-registration: | ||
|
||
1. Adjust the plugin registration | ||
================================== |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, not rendered until now. No link, no content, ... look ugly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like something is missing...
ExtensionUtility::configurePlugin( | ||
'Examples', | ||
'FalExamples', | ||
'HtmlParser', | ||
[ | ||
HtmlParserController::class => 'index', | ||
], | ||
+ [], | ||
+ ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something is completely broken here. 3rd Argument is an Array, but here it is "HtmlParser" and the indents of 6th (should be 5th) argument is missing 3 spaces. And in general the indents in PHP are 4 and not 7.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a diff, not a PHP file?
Documentation/CodeSnippets/FlexForms/Examples/PluginHaikuListRegistration.rst.txt
Show resolved
Hide resolved
Documentation/CodeSnippets/FlexForms/Examples/PluginHaikuListRegistration.rst.txt
Show resolved
Hide resolved
'tt_content', | ||
'--div--;Configuration,pi_flexform,', | ||
$pluginSignature, | ||
'after:subheader', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
subheader
is only available for CType header
. As subheader is not available for all other CTypes this field will be added to the last tab and behind last field.
Documentation/ExtensionArchitecture/BestPractises/NamingConventions.rst
Outdated
Show resolved
Hide resolved
'tt_content', | ||
'--div--;Configuration,pi_flexform,', | ||
$pluginSignature, | ||
'after:subheader', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works only for CType "header" as expected
Documentation/ExtensionArchitecture/BestPractises/NamingConventions.rst
Outdated
Show resolved
Hide resolved
Documentation/ExtensionArchitecture/BestPractises/NamingConventions.rst
Outdated
Show resolved
Hide resolved
#. A unique identifier for your plugin in UpperCamelCase: :php:`'PostSingle'` | ||
#. An array of allowed combinations of controllers and actions stored in an array | ||
#. (Optional) an array of controller name and action names which should not be cached | ||
#. Using any value but `ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT` is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only list_type
will create a deprecation log entry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the default value which is empty but defaults to list_type as well. So for all practical reasons: just use ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT. I don't think details beyond this are needed
Documentation/ApiOverview/ContentElements/ContentElementsWizard.rst
Outdated
Show resolved
Hide resolved
If the fourth parameter, `$nonCacheableControllerActions` was missing you can | ||
set it to an empty array, the default value. | ||
|
||
It is theoretically possible that the extension author did not use this utility |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes and I have seen ppl do that. You cannot rely on they used the Utility functions. But "theoretically"
ExtensionUtility::configurePlugin( | ||
'Examples', | ||
'FalExamples', | ||
'HtmlParser', | ||
[ | ||
HtmlParserController::class => 'index', | ||
], | ||
+ [], | ||
+ ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a diff, not a PHP file?
Documentation/CodeSnippets/FlexForms/Examples/PluginHaikuListRegistration.rst.txt
Show resolved
Hide resolved
Documentation/CodeSnippets/FlexForms/Examples/PluginHaikuListRegistration.rst.txt
Show resolved
Hide resolved
Documentation/CodeSnippets/FlexForms/Examples/PluginHaikuListRegistration.rst.txt
Outdated
Show resolved
Hide resolved
#. A unique identifier for your plugin in UpperCamelCase: :php:`'PostSingle'` | ||
#. An array of allowed combinations of controllers and actions stored in an array | ||
#. (Optional) an array of controller name and action names which should not be cached | ||
#. Using any value but `ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT` is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the default value which is empty but defaults to list_type as well. So for all practical reasons: just use ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT. I don't think details beyond this are needed
Co-authored-by: Stefan Frömken <123929835+sfroemkenjw@users.noreply.github.com>
Co-authored-by: Stefan Frömken <123929835+sfroemkenjw@users.noreply.github.com>
'tt_content', | ||
'--div--;Configuration,pi_flexform,', | ||
$pluginSignature, | ||
'after:subheader', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'after:subheader', | |
'after:header', |
Depends on TYPO3-Documentation/TYPO3CMS-Reference-TCA#1183
Resolves: TYPO3-Documentation/Changelog-To-Doc#1071
Releases: main