Fix tracking of auto disabled apps in Updater

Signed-off-by: Georg Ehrke <developer@georgehrke.com>
This commit is contained in:
Georg Ehrke 2019-07-22 21:28:03 +02:00 committed by Roeland Jago Douma
parent d14aed1048
commit f6c3424039
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 10 additions and 1 deletions

View File

@ -74,6 +74,13 @@ class Updater extends BasicEmitter {
4 => 'Fatal',
];
/**
* List of appIds that have automatically been disabled during upgrade
*
* @var String[]
*/
private $autoDisabledApps = [];
/**
* @param IConfig $config
* @param Checker $checker
@ -256,7 +263,8 @@ class Updater extends BasicEmitter {
// upgrade appstore apps
$this->upgradeAppStoreApps(\OC::$server->getAppManager()->getInstalledApps());
$this->upgradeAppStoreApps(\OC_App::$autoDisabledApps, true);
$autoDisabledApps = array_merge(\OC_App::$autoDisabledApps, $this->autoDisabledApps);
$this->upgradeAppStoreApps($autoDisabledApps, true);
// install new shipped apps on upgrade
OC_App::loadApps(['authentication']);
@ -405,6 +413,7 @@ class Updater extends BasicEmitter {
throw new \UnexpectedValueException('The files of the app "' . $app . '" were not correctly replaced before running the update');
}
\OC::$server->getAppManager()->disableApp($app);
$this->autoDisabledApps[] = $app;
$this->emit('\OC\Updater', 'incompatibleAppDisabled', array($app));
}
// no need to disable any app in case this is a non-core upgrade