Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] upgrade wizards for TYPO3 12 #439

Merged
merged 1 commit into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Build/phpstan10.neon
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ parameters:
-
message: '#Call to protected method getTypoScriptFrontendController\(\) of class TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer.#'
path: %currentWorkingDirectory%/Classes/DataProcessing/ContainerProcessor.php
-
message: '#Static method TYPO3\\CMS\\Core\\Core\\Bootstrap::initializeBackendUser\(\) invoked with 2 parameters.*#'
path: %currentWorkingDirectory%/*
12 changes: 11 additions & 1 deletion Classes/Updates/ContainerDeleteChildrenWithWrongPid.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@
use B13\Container\Integrity\Error\WrongPidError;
use B13\Container\Integrity\Integrity;
use B13\Container\Integrity\IntegrityFix;
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
use TYPO3\CMS\Core\Core\Bootstrap;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Http\ServerRequestFactory;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite;
use TYPO3\CMS\Install\Updates\RepeatableInterface;
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
Expand Down Expand Up @@ -76,7 +80,13 @@ public function updateNecessary(): bool
public function executeUpdate(): bool
{
if (Environment::isCli() === false) {
Bootstrap::initializeBackendUser();
if ((GeneralUtility::makeInstance(Typo3Version::class))->getMajorVersion() > 11) {
$requestFactory = GeneralUtility::makeInstance(ServerRequestFactory::class);
$request = $requestFactory::fromGlobals();
Bootstrap::initializeBackendUser(BackendUserAuthentication::class, $request);
} else {
Bootstrap::initializeBackendUser();
}
Bootstrap::initializeBackendAuthentication();
Bootstrap::initializeLanguageObject();
}
Expand Down
12 changes: 11 additions & 1 deletion Classes/Updates/ContainerMigrateSorting.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@
*/

use B13\Container\Integrity\Sorting;
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
use TYPO3\CMS\Core\Core\Bootstrap;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Http\ServerRequestFactory;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite;
use TYPO3\CMS\Install\Updates\RepeatableInterface;
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
Expand Down Expand Up @@ -63,7 +67,13 @@ public function updateNecessary(): bool
public function executeUpdate(): bool
{
if (Environment::isCli() === false) {
Bootstrap::initializeBackendUser();
if ((GeneralUtility::makeInstance(Typo3Version::class))->getMajorVersion() > 11) {
$requestFactory = GeneralUtility::makeInstance(ServerRequestFactory::class);
$request = $requestFactory::fromGlobals();
Bootstrap::initializeBackendUser(BackendUserAuthentication::class, $request);
} else {
Bootstrap::initializeBackendUser();
}
Bootstrap::initializeBackendAuthentication();
Bootstrap::initializeLanguageObject();
}
Expand Down
Loading