Commit 16c4eb4d authored by Jigal van Hemert's avatar Jigal van Hemert Committed by Wouter Wolters
Browse files

[BUGFIX] Allow Upgrade Wizards to install extensions

With the patch for #73605 the ObjectManager was removed throughout
the Install Tool. ListUtility, TerUtility, FileHandlingUtility and
InstallUtility need recursive DI and constructor argument handling.
Until the EM and the Upgrade Wizards are rewritten the OM is
reintroduced to make the Upgrade Wizards work.

Releases: master
Resolves: #75883
Change-Id: I4c68853befd33bfeba71bd19cfd1979369dd4803
Reviewed-on: https://review.typo3.org/47933


Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Nicole Cordes's avatarNicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes's avatarNicole Cordes <typo3@cordes.co>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
parent e1882ba1
......@@ -15,6 +15,7 @@ namespace TYPO3\CMS\Install\Updates;
*/
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Extensionmanager\Utility\Connection\TerUtility;
use TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility;
use TYPO3\CMS\Extensionmanager\Utility\InstallUtility;
......@@ -52,8 +53,11 @@ abstract class AbstractDownloadExtensionUpdate extends AbstractUpdate
protected function installExtension($extensionKey, &$customMessages)
{
$updateSuccessful = true;
/** @var $objectManager ObjectManager */
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
/** @var $extensionListUtility ListUtility */
$extensionListUtility = GeneralUtility::makeInstance(ListUtility::class);
$extensionListUtility = $objectManager->get(ListUtility::class);
$availableExtensions = $extensionListUtility->getAvailableExtensions();
$availableAndInstalledExtensions = $extensionListUtility->getAvailableAndInstalledExtensions($availableExtensions);
......@@ -61,7 +65,7 @@ abstract class AbstractDownloadExtensionUpdate extends AbstractUpdate
// Extension is not downloaded yet.
if (!is_array($availableAndInstalledExtensions[$extensionKey])) {
/** @var $extensionTerUtility TerUtility */
$extensionTerUtility = GeneralUtility::makeInstance(TerUtility::class);
$extensionTerUtility = $objectManager->get(TerUtility::class);
$extensionDetails = $this->getExtensionDetails($extensionKey);
if (empty($extensionDetails)) {
$updateSuccessful = false;
......@@ -79,7 +83,7 @@ abstract class AbstractDownloadExtensionUpdate extends AbstractUpdate
}
/** @var $extensionFileHandlingUtility FileHandlingUtility */
$extensionFileHandlingUtility = GeneralUtility::makeInstance(FileHandlingUtility::class);
$extensionFileHandlingUtility = $objectManager->get(FileHandlingUtility::class);
$extensionFileHandlingUtility->unpackExtensionFromExtensionDataArray($t3xExtracted);
// The listUtility now needs to have the regenerated list of packages
......@@ -88,7 +92,7 @@ abstract class AbstractDownloadExtensionUpdate extends AbstractUpdate
if ($updateSuccessful !== false) {
/** @var $extensionInstallUtility InstallUtility */
$extensionInstallUtility = GeneralUtility::makeInstance(InstallUtility::class);
$extensionInstallUtility = $objectManager->get(InstallUtility::class);
$extensionInstallUtility->install($extensionKey);
}
return $updateSuccessful;
......
Supports Markdown
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