Commit c2dc3933 authored by Tim Wagner's avatar Tim Wagner
Browse files

[BUGFIX] Make new MigrateFinishers upgrade wizard TYPO3 9 compatibility

parent 684336df
......@@ -31,7 +31,8 @@ use TYPO3\CMS\Core\Authentication\CommandLineUserAuthentication;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Form\Domain\Configuration\ConfigurationService;
use TYPO3\CMS\Core\Utility\VersionNumberUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Form\Mvc\Persistence\FormPersistenceManager;
use TYPO3\CMS\Install\Updates\ChattyInterface;
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
......@@ -105,6 +106,7 @@ class MigrateFinishersUpgrade implements UpgradeWizardInterface, ChattyInterface
$formChanged = TRUE;
}
}
unset($finisher);
}
if ($formChanged) {
......@@ -190,9 +192,14 @@ class MigrateFinishersUpgrade implements UpgradeWizardInterface, ChattyInterface
/**
* Initialize the FormPersistenceManager
*/
protected function initializeFormPersistenceManager() {
$this->formPersistenceManager = GeneralUtility::makeInstance(FormPersistenceManager::class);
$this->formPersistenceManager->initializeObject();
protected function initializeFormPersistenceManager(): void {
if (version_compare(VersionNumberUtility::getCurrentTypo3Version(), '10.0.0', '<')) {
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
$this->formPersistenceManager = $objectManager->get(FormPersistenceManager::class);
} else {
$this->formPersistenceManager = GeneralUtility::makeInstance(FormPersistenceManager::class);
$this->formPersistenceManager->initializeObject();
}
}
/**
......@@ -207,7 +214,16 @@ class MigrateFinishersUpgrade implements UpgradeWizardInterface, ChattyInterface
$GLOBALS['BE_USER']->start();
}
$GLOBALS['LANG'] = LanguageService::createFromUserPreferences($GLOBALS['BE_USER']);
if (version_compare(VersionNumberUtility::getCurrentTypo3Version(), '10.0.0', '<')) {
$GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
if (isset($GLOBALS['BE_USER']->uc['lang'])) {
$GLOBALS['LANG']->init($GLOBALS['BE_USER']->uc['lang']);
} else {
$GLOBALS['LANG']->init('default');
}
} else {
$GLOBALS['LANG'] = LanguageService::createFromUserPreferences($GLOBALS['BE_USER']);
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment