diff options
Diffstat (limited to 'lib/private/App/AppManager.php')
-rw-r--r-- | lib/private/App/AppManager.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/private/App/AppManager.php b/lib/private/App/AppManager.php index 4bf15c23fab..4d0859b1988 100644 --- a/lib/private/App/AppManager.php +++ b/lib/private/App/AppManager.php @@ -204,7 +204,9 @@ class AppManager implements IAppManager { } /** - * Check if an app is installed in the instance + * Check if an app is enabled in the instance + * + * Notice: This actually checks if the app is enabled and not only if it is installed. * * @param string $appId * @return bool @@ -287,6 +289,13 @@ class AppManager implements IAppManager { } unset($this->installedAppsCache[$appId]); $this->appConfig->setValue($appId, 'enabled', 'no'); + + // run uninstall steps + $appData = $this->getAppInfo($appId); + if (!is_null($appData)) { + \OC_App::executeRepairSteps($appId, $appData['repair-steps']['uninstall']); + } + $this->dispatcher->dispatch(ManagerEvent::EVENT_APP_DISABLE, new ManagerEvent( ManagerEvent::EVENT_APP_DISABLE, $appId )); @@ -349,7 +358,7 @@ class AppManager implements IAppManager { * * @param bool $path * @param null $lang - * @return array app info + * @return array|null app info */ public function getAppInfo(string $appId, bool $path = false, $lang = null) { if ($path) { @@ -402,7 +411,9 @@ class AppManager implements IAppManager { $incompatibleApps = array(); foreach ($apps as $appId) { $info = $this->getAppInfo($appId); - if (!\OC_App::isAppCompatible($version, $info)) { + if ($info === null) { + $incompatibleApps[] = ['id' => $appId]; + } else if (!\OC_App::isAppCompatible($version, $info)) { $incompatibleApps[] = $info; } } |