Run repair steps on uninstall in all cases
Signed-off-by: Tobia De Koninck <tobia@ledfan.be>
This commit is contained in:
parent
3867a74f0d
commit
539fdaea1e
|
@ -287,6 +287,16 @@ class AppManager implements IAppManager {
|
||||||
}
|
}
|
||||||
unset($this->installedAppsCache[$appId]);
|
unset($this->installedAppsCache[$appId]);
|
||||||
$this->appConfig->setValue($appId, 'enabled', 'no');
|
$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']);
|
||||||
|
}
|
||||||
|
|
||||||
|
// emit disable hook - needed anymore ?
|
||||||
|
\OC_Hook::emit('OC_App', 'pre_disable', array('app' => $appId));
|
||||||
|
|
||||||
$this->dispatcher->dispatch(ManagerEvent::EVENT_APP_DISABLE, new ManagerEvent(
|
$this->dispatcher->dispatch(ManagerEvent::EVENT_APP_DISABLE, new ManagerEvent(
|
||||||
ManagerEvent::EVENT_APP_DISABLE, $appId
|
ManagerEvent::EVENT_APP_DISABLE, $appId
|
||||||
));
|
));
|
||||||
|
|
|
@ -431,16 +431,6 @@ class OC_App {
|
||||||
// flush
|
// flush
|
||||||
self::$enabledAppsCache = [];
|
self::$enabledAppsCache = [];
|
||||||
|
|
||||||
// run uninstall steps
|
|
||||||
$appData = OC_App::getAppInfo($app);
|
|
||||||
if (!is_null($appData)) {
|
|
||||||
OC_App::executeRepairSteps($app, $appData['repair-steps']['uninstall']);
|
|
||||||
}
|
|
||||||
|
|
||||||
// emit disable hook - needed anymore ?
|
|
||||||
\OC_Hook::emit('OC_App', 'pre_disable', array('app' => $app));
|
|
||||||
|
|
||||||
// finally disable it
|
|
||||||
$appManager = \OC::$server->getAppManager();
|
$appManager = \OC::$server->getAppManager();
|
||||||
$appManager->disableApp($app);
|
$appManager->disableApp($app);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,6 @@ if (!array_key_exists('appid', $_POST)) {
|
||||||
$appIds = (array)$_POST['appid'];
|
$appIds = (array)$_POST['appid'];
|
||||||
foreach($appIds as $appId) {
|
foreach($appIds as $appId) {
|
||||||
$appId = OC_App::cleanAppId($appId);
|
$appId = OC_App::cleanAppId($appId);
|
||||||
OC_App::disable($appId);
|
\OC::$server->getAppManager()->disableApp($appId);
|
||||||
}
|
}
|
||||||
OC_JSON::success();
|
OC_JSON::success();
|
||||||
|
|
Loading…
Reference in New Issue