Breaking: #107784 - Remove backend layout data provider registration via $GLOBALS
See forge#107784
Description
The possibility to register backend layout data providers via
$GLOBALS
has been replaced by autoconfiguration using the service tag
page_.
The tag is automatically added when a class implements
\TYPO3\. Manual
configuration via Services. remains possible, especially when
autoconfiguration is disabled.
Developers need to adapt existing implementations by adding the new method
get, as outlined in
Feature: #107784 - Autoconfigure backend layout data providers.
Additionally, the possibility to dynamically add backend layout data providers
to the global
Data via its
add method has been
removed. Developers should register their data providers as service definitions
in the container as described above.
Impact
Using the global array
$GLOBALS
to register backend layout data providers has no effect in TYPO3 v14.0 and
later.
Affected installations
All installations that use
$GLOBALS
for backend layout data provider registration are affected.
This registration is typically done in an ext_ file.
The extension scanner will report such usages.
Migration
Migrate existing registrations to the new autoconfiguration-based approach.
Before:
use Vendor\MyExtension\View\BackendLayout\MyLayoutDataProvider;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['BackendLayoutDataProvider']['my_provider']
= MyLayoutDataProvider::class;
After:
use TYPO3\CMS\Backend\View\BackendLayout\DataProviderInterface;
final class MyLayoutDataProvider implements DataProviderInterface
{
// ...
public function getIdentifier(): string
{
return 'my_provider';
}
}
If you need to support multiple TYPO3 versions, you can implement both
registration methods (via
$GLOBALS and via autoconfiguration).
Ensure that
get is implemented, which is backward compatible
with older TYPO3 versions even if unused.