Skip to content

Commit 023c01b

Browse files
committed
Run repair steps on uninstall in all cases
1 parent ce7c62d commit 023c01b

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

lib/private/App/AppManager.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
use OCP\IGroupManager;
4040
use OCP\IUser;
4141
use OCP\IUserSession;
42+
use OCP\App;
4243
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
4344

4445
class AppManager implements IAppManager {
@@ -280,6 +281,16 @@ public function disableApp($appId) {
280281
}
281282
unset($this->installedAppsCache[$appId]);
282283
$this->appConfig->setValue($appId, 'enabled', 'no');
284+
285+
// run uninstall steps
286+
$appData = App::getAppInfo($appId);
287+
if (!is_null($appData)) {
288+
\OC_App::executeRepairSteps($appId, $appData['repair-steps']['uninstall']);
289+
}
290+
291+
// emit disable hook - needed anymore ?
292+
\OC_Hook::emit('OC_App', 'pre_disable', array('app' => $appId));
293+
283294
$this->dispatcher->dispatch(ManagerEvent::EVENT_APP_DISABLE, new ManagerEvent(
284295
ManagerEvent::EVENT_APP_DISABLE, $appId
285296
));

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)