Deprecation: #96903 - Deprecate old ModuleTemplate API
See forge#96903
Description
With the introduction of the simplified ModuleTemplate API
a series of PHP methods in backend related Module
class became obsolete.
These methods are now marked as deprecated in TYPO3 v12 and will be removed in TYPO3 v13 to encourage backend modules switching to the new API which is easier to use and allows overriding backend templates.
The following methods should not be used anymore:
Module
andTemplate->set Content () Module
: These methods were the heart of the old API, using aTemplate->render Content () Standalone
for module template rendering. They are obsolete usingView Module
orTemplate->render () Module
where the outer ModuleTemplate HTML is referenced in "main body" templates as layout.Template->render Response () Module
: This was an additional helper forTemplate->get View () Module
andTemplate->set Content () Module
and is deprecated together with these.Template->render Content () Module
andTemplate->get Body Tag () Module
: ModuleTemplate should be a data sink. It should not be abused to carry data around that is later retrieved again. Controllers that need these methods should be refactored slightly to carry the information around themselves.Template->is Ui Block () Module
: This was a helper method for "third level" menu registration of (especially) the info module. It is unused in Core since at least TYPO3 v7. Extensions most likely don't use it.Template->register Module Menu () Module
: This is a helper to render a "tabbed" view of item titles and item content. Using the methods leads to strange controller code that relies on multiple Fluid view instances at the same time. Consuming controllers should instead add the needed HTML to their templates directly. Example HTML can be found in the EXT:styleguide backend module, section "Tabs".Template->get Dynamic Tab Menu () Module
: This is a tiny helper method to render aTemplate->header () <h1>
. It was used to make the page title editable in a couple of controllers in the past. Extensions should put this HTML directly into their templates.
Impact
Methods set
, header
and get
are rather common names, the extension
scanner is not configured to scan for them. All other methods names are scanned, the extension scanner
will report possible usages as weak match.
All methods will trigger a PHP E_
error when called. One exception is set
,
which is always used in combination with render
to be useful, so only one deprecation
log entry is created when using both methods.
Affected Installations
In general, instances with extensions that add custom backend modules may be affected.
Migration
See the description section and simplified ModuleTemplate API for migration information.