Skip to content

Commit 8c9875d

Browse files
committed
[BUGFIX] Mitigate deprecated extbase ViewInterface
TYPO3 v11.5 started streamlining the view implementation, which included deprecating the extbase `ViewInterface`. Extensions supporting two TYPO3 core version need to take care and the migration path for controllers overriding the `initialzeView` method is stated in the changelog [1]. This change follows the recommended migration path and removes the deprecated interface as method native type declarion for the `$view` argument, avoiding in TYPO3 v12 the exception TYPO3\CMS\Extbase\Reflection\Exception\UnknownClassException Class "TYPO3\CMS\Extbase\Mvc\View\ViewInterface" does not exist. Reflection failed. while still making required adjustments. [1] https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/11.5/Deprecation-95222-ExtbaseViewInterface.html Resolves: #22
1 parent 15d253a commit 8c9875d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Classes/Controller/CleanupController.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
use TYPO3\CMS\Core\Resource\ResourceStorage;
2626
use TYPO3\CMS\Core\Utility\GeneralUtility;
2727
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
28-
use TYPO3\CMS\Extbase\Mvc\View\ViewInterface;
2928
use WebVision\WvFileCleanup\Domain\Repository\FileRepository;
3029

3130
/**
@@ -64,7 +63,11 @@ public function initializeAction(): void
6463
$this->moduleTemplate = $this->moduleTemplateFactory->create($this->request);
6564
}
6665

67-
public function initializeView(ViewInterface $view): void
66+
/**
67+
* Note that `$view` does not have native type declaration by intention to follow the recommended migration path for
68+
* https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/11.5/Deprecation-95222-ExtbaseViewInterface.html.
69+
*/
70+
public function initializeView($view): void
6871
{
6972
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/ContextMenu');
7073
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/WvFileCleanup/Cleanup');

0 commit comments

Comments
 (0)