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

View file

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