]> source.dussan.org Git - nextcloud-server.git/commitdiff
Run repair steps when enabling an app that has already been installed 15783/head
authorJulius Härtl <jus@bitgrid.net>
Wed, 29 May 2019 06:05:30 +0000 (08:05 +0200)
committerJulius Härtl <jus@bitgrid.net>
Wed, 5 Jun 2019 11:52:46 +0000 (13:52 +0200)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
lib/private/Installer.php

index a410c6a011fc4d475564260cbc0ea0062fd5e86c..b96c614aa653cbe52c455a2dcf2efdbcc7480357 100644 (file)
@@ -129,6 +129,11 @@ class Installer {
                \OC_App::checkAppDependencies($this->config, $l, $info, $ignoreMax);
                \OC_App::registerAutoloading($appId, $basedir);
 
+               $previousVersion = $this->config->getAppValue($info['id'], 'installed_version', false);
+               if ($previousVersion) {
+                       OC_App::executeRepairSteps($appId, $info['repair-steps']['pre-migration']);
+               }
+
                //install the database
                if(is_file($basedir.'/appinfo/database.xml')) {
                        if (\OC::$server->getConfig()->getAppValue($info['id'], 'installed_version') === null) {
@@ -140,6 +145,9 @@ class Installer {
                        $ms = new \OC\DB\MigrationService($info['id'], \OC::$server->getDatabaseConnection());
                        $ms->migrate();
                }
+               if ($previousVersion) {
+                       OC_App::executeRepairSteps($appId, $info['repair-steps']['post-migration']);
+               }
 
                \OC_App::setupBackgroundJobs($info['background-jobs']);