TYPO3 v15 dev-main snapshot ()
This commit is contained in:
+58
@@ -0,0 +1,58 @@
|
||||
.. include:: /Includes.rst.txt
|
||||
|
||||
.. _deprecation-99564-1673958788:
|
||||
|
||||
==================================================================
|
||||
Deprecation: #99564 - Deprecated BackendUtility::getDropdownMenu()
|
||||
==================================================================
|
||||
|
||||
See :issue:`99564`
|
||||
|
||||
Description
|
||||
===========
|
||||
|
||||
Method :php:`\TYPO3\CMS\Backend\Utility\BackendUtility::getDropdownMenu()` has
|
||||
been marked deprecated and should no longer be used.
|
||||
|
||||
|
||||
Impact
|
||||
======
|
||||
|
||||
Calling the method will raise a deprecation level log error and will
|
||||
stop working with TYPO3 v13.
|
||||
|
||||
|
||||
Affected installations
|
||||
======================
|
||||
|
||||
The method may be used in extensions that add backend modules. The
|
||||
extension scanner finds usages with a strong match.
|
||||
|
||||
Migration
|
||||
=========
|
||||
|
||||
:php:`BackendUtility::getDropdownMenu()` is a helper method that renders a
|
||||
select dropdown and is typically used to trigger a `GET` request when
|
||||
the user selects an option.
|
||||
|
||||
In general, such HTML should not be generated by PHP, but by Fluid templating.
|
||||
The method is thus typically used by old school backend modules that have not
|
||||
or only partially been transferred to Fluid, improving the controller-view
|
||||
separation.
|
||||
|
||||
The most simple and ugly migration is to copy the method to an own controller
|
||||
that consumes the method. The better solution is to add the arguments as variables
|
||||
to the Fluid template and render the dropdown in Fluid. This should be a pretty
|
||||
straight transition as well and typically avoids another :html:`<f:format.raw>`
|
||||
ViewHelper usage.
|
||||
|
||||
Note that requests send by these dropdowns should switch from `GET` to `POST` in
|
||||
case they change the server state (e. g. changing records) along the way: State changing
|
||||
requests should be restricted to POST as an additional security measure, and to
|
||||
not violate the HTTP protocol. The TYPO3 Core comes with more and more examples
|
||||
on how to handle this properly. For instance, all drop downs and checkbox toggles
|
||||
of the `tstemplate` extension (:guilabel:`Site Management > TypoScript` backend module)
|
||||
have been changed to do this and can be studied on how to trigger immediate
|
||||
`POST` actions when clicking such elements.
|
||||
|
||||
.. index:: Backend, PHP-API, FullyScanned, ext:backend
|
||||
Reference in New Issue
Block a user