Breaking: #107871 - Remove backend avatar provider registration via
$GLOBALS
See forge#107871
Description
Registering backend avatar providers via
$GLOBALS
has been replaced by autoconfiguration using the
backend.
service tag. This tag is added automatically when the PHP attribute
# is applied. Manual configuration in
Services. is possible, particularly if autoconfiguration is
disabled.
Impact
Utilizing the
$GLOBALS
array has no effect in TYPO3 v14.0 and later.
Affected installations
All installations that use
$GLOBALS
to register backend avatar providers are affected. This registration is
typically performed in an ext_ file. The extension
scanner will report any such usages.
Migration
Migrate existing registrations to the new autoconfigured-based approach.
Before:
use Vendor\MyExtension\Backend\Avatar\MyAvatarProvider;
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['backend']['avatarProviders']['my_provider'] = [
'provider' => MyAvatarProvider::class,
'before' => ['provider-1'],
'after' => ['provider-2'],
];
After:
use TYPO3\CMS\Backend\Attribute\AsAvatarProvider;
use TYPO3\CMS\Backend\Backend\Avatar\AvatarProviderInterface;
#[AsAvatarProvider('my_provider', before: ['provider-1'], after: ['provider-2'])]
final class MyAvatarProvider implements AvatarProviderInterface
{
// ...
}
If you need to support multiple TYPO3 Core versions simultaneously, ensure that
both registration methods are implemented: the legacy registration via
$GLOBALS as well as the new tag-based approach.