Deprecation: #104773 - ext:backend LoginProviderInterface changes

See forge#104773

Description

Method \TYPO3\CMS\Backend\LoginProvider\LoginProviderInterface->render() has been marked as deprecated and is substituted by LoginProviderInterface->modifyView() that will be added to the interface in TYPO3 v14, removing render() from the interface in v14.

Related to this, event \TYPO3\CMS\Backend\LoginProvider\Event\ModifyPageLayoutOnLoginProviderSelectionEvent has been changed to deprecate getController() and getPageRenderer(), while getRequest() has been added. getView() now typically returns an instance of ViewInterface.

This change is related to the general View refactoring.

Impact

The default LoginProviderInterface implementation is UsernamePasswordLoginProvider provided by ext:core. This consumer has been adapted.

Using LoginProviderInterface->render() in TYPO3 v13 will trigger a deprecation level log entry and will fail in v14.

Affected installations

Instances with custom login providers that change the TYPO3 backend login field rendering may be affected. The extension scanner is not configured to find usages, since method name render() is too common. A deprecation level log message is triggered upon use of the old method.

Migration

Consumers of LoginProviderInterface should implement modifyView() instead, the transition should be smooth. Consumers that need the PageRenderer for JavaScript magic, should use dependency injection to receive an instance.

The default implementation in UsernamePasswordLoginProvider is a good example. Extensions that need to configure additional template, layout or partial lookup paths can extend them:

if ($view instanceof FluidViewAdapter) {
    $templatePaths = $view->getRenderingContext()->getTemplatePaths();
    $templateRootPaths = $templatePaths->getTemplateRootPaths();
    $templateRootPaths[] = 'EXT:my_extension/Resources/Private/Templates';
    $templatePaths->setTemplateRootPaths($templateRootPaths);
}
Copied!

Consumers of ModifyPageLayoutOnLoginProviderSelectionEvent should use the request instead, and/or should get an instance of PageRenderer injected as well.