Breaking: #107784 - Remove backend layout data provider registration via
$GLOBALS
See forge#107784
Description
The possibility to register backend layout data provider via
$GLOBALS
has been replaced by autoconfiguration via the
page_
service tag. The tag is automatically added based on the implemented
Data. However, manual configuration in the
Services. is still possible, especially in case no
autoconfiguration is enabled. Developers however need to adapt existing
implementations by adding the new method
get, as
outlined in the appropriate feature description.
In addition, the possibility to dynamically add backend layout data providers to
the global
Data by using their
add method has
been removed. Developers are advised to make data providers available in the
service container as described above.
Impact
Utilizing the
$GLOBALS
array won't have any effect anymore in TYPO3 v14.0+.
Affected installations
All installations where
$GLOBALS
is used for backend layout data provider registration are affected. This
registration is normally done in an ext_ file. The
extension scanner will report any usages.
Migration
Migrate existing registrations to the new autoconfigured-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 Core versions at once, make sure to
implement both registration methods (via
$GLOBALS and using
autoconfiguration). Make sure to implement the new method
get, which is backwards compatible (even if not used in
older TYPO3 versions).