diff --git a/lib/private/Updater.php b/lib/private/Updater.php index acd62dedde014..7f98d7e2e0a8c 100644 --- a/lib/private/Updater.php +++ b/lib/private/Updater.php @@ -268,7 +268,9 @@ private function doUpgrade($currentVersion, $installedVersion) { // upgrade appstore apps $this->upgradeAppStoreApps($appManager->getInstalledApps()); $autoDisabledApps = $appManager->getAutoDisabledApps(); - $this->upgradeAppStoreApps($autoDisabledApps, true); + if (!empty($autoDisabledApps)) { + $this->upgradeAppStoreApps(array_keys($autoDisabledApps), $autoDisabledApps); + } // install new shipped apps on upgrade $errors = Installer::installShippedApps(true); @@ -448,8 +450,8 @@ private function isCodeUpgrade() { } /** - * @param array $disabledApps - * @param bool $reenable + * @param array $apps + * @param array $previousEnableStates * @throws \Exception */ private function upgradeAppStoreApps(array $disabledApps, $reenable = false) { @@ -462,10 +464,10 @@ private function upgradeAppStoreApps(array $disabledApps, $reenable = false) { } $this->emit('\OC\Updater', 'checkAppStoreApp', [$app]); - if ($reenable) { + if (!empty($previousEnableStates)) { $ocApp = new \OC_App(); - if (!empty($previousEnableSetting)) { - $ocApp->enable($app, $previousEnableSetting); + if (!empty($previousEnableStates[$app])) { + $ocApp->enable($app, $previousEnableStates[$app]); } else { $ocApp->enable($app); }