diff --git a/Classes/Controller/BackendModuleController.php b/Classes/Controller/BackendModuleController.php index d6af637..cf50a54 100644 --- a/Classes/Controller/BackendModuleController.php +++ b/Classes/Controller/BackendModuleController.php @@ -31,7 +31,6 @@ use Aoe\Cachemgm\Utility\CacheUtility; use Psr\Http\Message\ResponseInterface; use TYPO3\CMS\Backend\Template\ModuleTemplateFactory; -use TYPO3\CMS\Backend\View\BackendTemplateView; use TYPO3\CMS\Core\Cache\Backend\BackendInterface; use TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend; use TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend; @@ -44,6 +43,7 @@ use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; use TYPO3\CMS\Extbase\Mvc\Exception\NoSuchArgumentException; use TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder; +use TYPO3\CMS\Fluid\View\TemplatePaths; class BackendModuleController extends ActionController { @@ -54,15 +54,13 @@ class BackendModuleController extends ActionController /** * BackendTemplateContainer - * - * @var BackendTemplateView */ protected $view; /** * @var CacheManager */ - private object $cacheManager; + private readonly object $cacheManager; /** * @var LanguageService @@ -145,11 +143,26 @@ public function flushAction(): ResponseInterface return new ForwardResponse('index'); } - protected function initializeView($view): void + protected function initializeView(): void { - $this->view->setLayoutRootPaths(['EXT:cachemgm/Resources/Private/Layouts']); - $this->view->setPartialRootPaths(['EXT:cachemgm/Resources/Private/Partials']); - $this->view->setTemplateRootPaths(['EXT:cachemgm/Resources/Private/Templates/BackendModule']); + /* + $moduleTemplate = $this->moduleTemplateFactory->create($this->request); + $templatePaths = new TemplatePaths(); + $templatePaths->setLayoutRootPaths(['EXT:cachemgm/Resources/Private/Layouts']); + $templatePaths->setPartialRootPaths(['EXT:cachemgm/Resources/Private/Partials']); + $templatePaths->setTemplateRootPaths(['EXT:cachemgm/Resources/Private/Templates/BackendModule']); + + $moduleTemplate->setContent($this->view->setTemplatePaths($templatePaths)); + */ + + if ($this->view instanceof \TYPO3\CMS\Fluid\View\StandaloneView) { + $this->view->setLayoutRootPaths(['EXT:cachemgm/Resources/Private/Layouts']); + $this->view->setPartialRootPaths(['EXT:cachemgm/Resources/Private/Partials']); + $this->view->setTemplateRootPaths(['EXT:cachemgm/Resources/Private/Templates/BackendModule']); + } + + $moduleTemplate = $this->moduleTemplateFactory->create($this->request); + $moduleTemplate->setContent($this->view->render()); } /** diff --git a/Tests/Functional/FunctionalTests.xml b/Tests/Functional/FunctionalTests.xml index a195b28..fb64f27 100644 --- a/Tests/Functional/FunctionalTests.xml +++ b/Tests/Functional/FunctionalTests.xml @@ -4,7 +4,7 @@ bootstrap="../../.Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTestsBootstrap.php" backupGlobals="true" colors="true" - processIsolation="false" + processIsolation="true" stopOnError="false" stopOnFailure="false" stopOnIncomplete="false" diff --git a/Tests/Unit/Utility/CacheUtilityTest.php b/Tests/Unit/Utility/CacheUtilityTest.php index 35bfbdc..4f69186 100644 --- a/Tests/Unit/Utility/CacheUtilityTest.php +++ b/Tests/Unit/Utility/CacheUtilityTest.php @@ -37,6 +37,7 @@ class CacheUtilityTest extends UnitTestCase { protected function setUp(): void { + parent::setUp(); $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'] = [ 'cache_core' => [ 'frontend' => PhpFrontend::class, diff --git a/code-quality/phpstan-baseline.neon b/code-quality/phpstan-baseline.neon index e841232..364905f 100644 --- a/code-quality/phpstan-baseline.neon +++ b/code-quality/phpstan-baseline.neon @@ -1,16 +1,2 @@ parameters: ignoreErrors: - - - message: "#^Anonymous variable in a `\\$queryBuilder\\-\\>count\\('\\*'\\)\\-\\>\\.\\.\\.\\(\\)` method call can lead to false dead methods\\. Make sure the variable type is known$#" - count: 1 - path: ../Classes/Domain/Repository/AbstractRepository.php - - - - message: "#^Anonymous variable in a `\\$queryBuilder\\-\\>count\\('\\*'\\)\\-\\>from\\(\\$table\\)\\-\\>\\.\\.\\.\\(\\)` method call can lead to false dead methods\\. Make sure the variable type is known$#" - count: 1 - path: ../Classes/Domain/Repository/AbstractRepository.php - - - - message: "#^Anonymous variable in a `\\$queryBuilder\\-\\>count\\('\\*'\\)\\-\\>from\\(\\$table\\)\\-\\>execute\\(\\)\\-\\>\\.\\.\\.\\(\\)` method call can lead to false dead methods\\. Make sure the variable type is known$#" - count: 1 - path: ../Classes/Domain/Repository/AbstractRepository.php \ No newline at end of file diff --git a/composer.json b/composer.json index b9ac069..6e7edf0 100644 --- a/composer.json +++ b/composer.json @@ -17,14 +17,14 @@ } ], "require": { - "php": "^8.0", + "php": "^8.1", "typo3/cms-core": "^12.4", "typo3/cms-backend": "^12.4", "typo3/cms-frontend": "^12.4", "psr/http-message": "^1.0" }, "require-dev": { - "typo3/testing-framework": "^7.0", + "typo3/testing-framework": "^8.0", "phpcompatibility/php-compatibility": "^9.3", "phpstan/phpstan": "^1.10", "rector/rector": "^1.0", @@ -85,7 +85,7 @@ "./.Build/bin/phpstan analyse -c code-quality/phpstan.neon --memory-limit=1G --generate-baseline" ], "code-compatibility": [ - "[ -e ./.Build/vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcs ] || composer install", + "[ -e ./.Build/vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcs ] || composer update", "[ -d ./reports/php_checkstyle ] || mkdir -p reports/php_checkstyle/", "./code-quality/configure-checkstyle.sh", "./.Build/vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcs -d memory_limit=1G --standard=PHPCompatibility --colors --ignore=*/.Build/*,*.min.js -p . --runtime-set testVersion 8.3"