Skip to content

Commit f694c6c

Browse files
committed
Run repair steps on uninstall in all cases
Signed-off-by: Tobia De Koninck <tobia@ledfan.be>
1 parent ce7c62d commit f694c6c

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

lib/private/App/AppManager.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,16 @@ public function disableApp($appId) {
280280
}
281281
unset($this->installedAppsCache[$appId]);
282282
$this->appConfig->setValue($appId, 'enabled', 'no');
283+
284+
// run uninstall steps
285+
$appData = $this->getAppInfo($appId);
286+
if (!is_null($appData)) {
287+
\OC_App::executeRepairSteps($appId, $appData['repair-steps']['uninstall']);
288+
}
289+
290+
// emit disable hook - needed anymore ?
291+
\OC_Hook::emit('OC_App', 'pre_disable', array('app' => $appId));
292+
283293
$this->dispatcher->dispatch(ManagerEvent::EVENT_APP_DISABLE, new ManagerEvent(
284294
ManagerEvent::EVENT_APP_DISABLE, $appId
285295
));

lib/private/legacy/app.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -420,16 +420,6 @@ public static function disable($app) {
420420
// flush
421421
self::$enabledAppsCache = array();
422422

423-
// run uninstall steps
424-
$appData = OC_App::getAppInfo($app);
425-
if (!is_null($appData)) {
426-
OC_App::executeRepairSteps($app, $appData['repair-steps']['uninstall']);
427-
}
428-
429-
// emit disable hook - needed anymore ?
430-
\OC_Hook::emit('OC_App', 'pre_disable', array('app' => $app));
431-
432-
// finally disable it
433423
$appManager = \OC::$server->getAppManager();
434424
$appManager->disableApp($app);
435425
}

settings/ajax/disableapp.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@
3939
$appIds = (array)$_POST['appid'];
4040
foreach($appIds as $appId) {
4141
$appId = OC_App::cleanAppId($appId);
42-
OC_App::disable($appId);
42+
\OC::$server->getAppManager()->disableApp($appId);
4343
}
4444
OC_JSON::success();

0 commit comments

Comments
 (0)