Deprecation: #95222 - Extbase ViewInterface
See forge#95222
Description
To further streamline Fluid view-related class inheritance and dependencies,
the interface
\TYPO3\
has been marked
as deprecated and will be removed in TYPO3 v12.
Impact
This deprecation has minimal impact on TYPO3 v11:
- The interface remains available in the Core without triggering a E_USER_DEPRECATED warning.
- ViewInterface primarily differs from other view-related classes by
requiring an implementation of
initialize
, a method that was never actively used within TYPO3's Core. This method should not be confused withView () initialize
in Extbase controllers, which is frequently implemented by developers and serves a different purpose. The removal ofView () initialize
only affects view-related logic and does not impact controller initialization.View () - Another deviation is the method
set
, which is also deprecated becauseController Context () Controller
itself is marked as deprecated.Context
Affected Installations
The extension scanner will detect usages of Extbase
View
as a
strong match.
Migration
Adjusting initializeView() method signature in controllers
Some extensions may rely on
View
type hints, particularly in
the
initialize
method of Extbase action controllers. The default
implementation of
initialize
in
Action
is empty.
In TYPO3 v12:
- This empty method will be removed from
Action
.Controller - However, if an
initialize
method exists in a subclass ofView () Action
, it will still be called.Controller - Extension authors should not call
parent::
, as this parent method will no longer exist.initialize View ($view) - The method signature should be updated to prevent PHP contravariance violations:
Old:
protected function initializeView(ViewInterface $view)
New:
protected function initializeView($view)
Replacing ViewInterface
Instead of using
\TYPO3\
, extension
authors should switch to:
\TYPO3\
— typically in non-Extbase-related classes.CMS\ Fluid\ View\ Standalone View \TYPO3Fluid\
— for a more generic replacement.Fluid\ View\ View Interface
Handling Custom Views
If an extension defines a custom view implementing
View
, note
that auto-configuration based on this interface will be removed in TYPO3 v12.
As a result, manual service configuration in Services.
may
be necessary.