Skip to content

Commit

Permalink
[TASK] Provide upgradeWizard to enable adminPanel
Browse files Browse the repository at this point in the history
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
susannemoog authored and neufeind committed Apr 4, 2018
1 parent 9c9878e commit 65674a8
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
81 changes: 81 additions & 0 deletions typo3/sysext/install/Classes/Updates/AdminPanelInstall.php
@@ -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;
}
}
2 changes: 2 additions & 0 deletions typo3/sysext/install/ext_localconf.php
Expand Up @@ -62,6 +62,8 @@
= \TYPO3\CMS\Install\Updates\BackendLayoutIconUpdateWizard::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['redirects']
= \TYPO3\CMS\Install\Updates\RedirectsExtensionUpdate::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['adminPanelInstall']
= \TYPO3\CMS\Install\Updates\AdminPanelInstall::class;

$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
$icons = [
Expand Down

0 comments on commit 65674a8

Please sign in to comment.