summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-07-25 11:37:10 +0200
committerGitHub <noreply@github.com>2018-07-25 11:37:10 +0200
commit7eb74186efc329a1aa6344cc6fbbe1c2ffc16393 (patch)
treed6f58d0abe94b2500045cc069b3a653d36b80e36 /lib/private
parentfb77ff9da432f5cf304a67a538ed497ee437c155 (diff)
parent4b49f810b720ddf65dfe6384f9cb3b6d4975c4e2 (diff)
downloadnextcloud-server-7eb74186efc329a1aa6344cc6fbbe1c2ffc16393.tar.gz
nextcloud-server-7eb74186efc329a1aa6344cc6fbbe1c2ffc16393.zip
Merge pull request #8380 from nextcloud/bugfix/noid/reenable-disabled-apps
Re-enable apps that got automatically disabled while updating
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Updater.php9
-rw-r--r--lib/private/legacy/app.php2
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/private/Updater.php b/lib/private/Updater.php
index 4098d1b767d..8a2b1cd188c 100644
--- a/lib/private/Updater.php
+++ b/lib/private/Updater.php
@@ -254,6 +254,7 @@ class Updater extends BasicEmitter {
// upgrade appstore apps
$this->upgradeAppStoreApps(\OC::$server->getAppManager()->getInstalledApps());
+ $this->upgradeAppStoreApps(\OC_App::$autoDisabledApps, true);
// install new shipped apps on upgrade
OC_App::loadApps(['authentication']);
@@ -434,9 +435,10 @@ class Updater extends BasicEmitter {
/**
* @param array $disabledApps
+ * @param bool $reenable
* @throws \Exception
*/
- private function upgradeAppStoreApps(array $disabledApps) {
+ private function upgradeAppStoreApps(array $disabledApps, $reenable = false) {
foreach($disabledApps as $app) {
try {
$this->emit('\OC\Updater', 'checkAppStoreAppBefore', [$app]);
@@ -445,6 +447,11 @@ class Updater extends BasicEmitter {
$this->installer->updateAppstoreApp($app);
}
$this->emit('\OC\Updater', 'checkAppStoreApp', [$app]);
+
+ if ($reenable) {
+ $ocApp = new \OC_App();
+ $ocApp->enable($app);
+ }
} catch (\Exception $ex) {
$this->log->logException($ex, ['app' => 'core']);
}
diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php
index 0a5d31a9873..ab52a68caeb 100644
--- a/lib/private/legacy/app.php
+++ b/lib/private/legacy/app.php
@@ -70,6 +70,7 @@ class OC_App {
static private $loadedApps = [];
static private $altLogin = [];
static private $alreadyRegistered = [];
+ static public $autoDisabledApps = [];
const officialApp = 200;
/**
@@ -156,6 +157,7 @@ class OC_App {
if (!\OC::$server->getAppManager()->isShipped($app)) {
// Only disable apps which are not shipped
\OC::$server->getAppManager()->disableApp($app);
+ self::$autoDisabledApps[] = $app;
}
}
\OC::$server->getEventLogger()->end('load_app_' . $app);