Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Provide upgradeWizard to enable adminPanel
The adminpanel has been extracted to an own extension which should be installed on upgrading to get the same behaviour as pre-extraction. Resolves: #84583 Releases: master Change-Id: Ic536dc75af205ff3e7c7d261f2371fc56169cf9b Reviewed-on: https://review.typo3.org/56519 Tested-by: TYPO3com <no-reply@typo3.com> Reviewed-by: Georg Ringer <georg.ringer@gmail.com> Tested-by: Georg Ringer <georg.ringer@gmail.com> Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de> Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
- Loading branch information
1 parent
9c9878e
commit 65674a8
Showing
2 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
81 changes: 81 additions & 0 deletions
81
typo3/sysext/install/Classes/Updates/AdminPanelInstall.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace TYPO3\CMS\Install\Updates; | ||
|
||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
use TYPO3\CMS\Extbase\Object\ObjectManager; | ||
use TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException; | ||
use TYPO3\CMS\Extensionmanager\Utility\InstallUtility; | ||
|
||
/** | ||
* Installs EXT:adminpanel | ||
*/ | ||
class AdminPanelInstall extends AbstractUpdate | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $title = 'Install extension "adminpanel"'; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $extensionKey = 'adminpanel'; | ||
|
||
/** | ||
* Checks if an update is needed | ||
* | ||
* @param string $description The description for the update | ||
* @return bool Whether an update is needed (true) or not (false) | ||
*/ | ||
public function checkForUpdate(&$description): bool | ||
{ | ||
$description = 'The TYPO3 admin panel was extracted to an own extension. This update installs the extension.'; | ||
|
||
if (ExtensionManagementUtility::isLoaded('adminpanel')) { | ||
$this->markWizardAsDone(); | ||
} | ||
|
||
$updateNeeded = false; | ||
if (!$this->isWizardDone()) { | ||
$updateNeeded = true; | ||
} | ||
return $updateNeeded; | ||
} | ||
|
||
/** | ||
* Performs the update | ||
* | ||
* @param array $databaseQueries Queries done in this update | ||
* @param string $customMessage Custom message | ||
* @return bool | ||
*/ | ||
public function performUpdate(array &$databaseQueries, &$customMessage): bool | ||
{ | ||
$objectManager = GeneralUtility::makeInstance(ObjectManager::class); | ||
$extensionInstallUtility = $objectManager->get(InstallUtility::class); | ||
try { | ||
$extensionInstallUtility->install('adminpanel'); | ||
$updateSuccessful = true; | ||
$this->markWizardAsDone(); | ||
} catch (ExtensionManagerException $e) { | ||
$updateSuccessful = false; | ||
} | ||
return $updateSuccessful; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters