Skip to content
Snippets Groups Projects
Commit 6f329dcb authored by Vincent Petry's avatar Vincent Petry
Browse files

Set version AFTER a successful update

If an app upgrade failed, the core version will not be increased either
in the database. This will re-display the update page and make it
possible to redo the apps upgrade.

Note that any core repair routine must take into account that an update
might need to be redone again even though the core's DB state is already
the one of the new version.
parent 9834e385
No related branches found
No related tags found
No related merge requests found
...@@ -212,8 +212,6 @@ class Updater extends BasicEmitter { ...@@ -212,8 +212,6 @@ class Updater extends BasicEmitter {
\OC_DB::updateDbFromStructure(\OC::$SERVERROOT . '/db_structure.xml'); \OC_DB::updateDbFromStructure(\OC::$SERVERROOT . '/db_structure.xml');
$this->emit('\OC\Updater', 'dbUpgrade'); $this->emit('\OC\Updater', 'dbUpgrade');
// TODO: why not do this at the end ?
\OC_Config::setValue('version', implode('.', \OC_Util::getVersion()));
$disabledApps = \OC_App::checkAppsRequirements(); $disabledApps = \OC_App::checkAppsRequirements();
if (!empty($disabledApps)) { if (!empty($disabledApps)) {
$this->emit('\OC\Updater', 'disabledApps', array($disabledApps)); $this->emit('\OC\Updater', 'disabledApps', array($disabledApps));
...@@ -227,6 +225,9 @@ class Updater extends BasicEmitter { ...@@ -227,6 +225,9 @@ class Updater extends BasicEmitter {
//Invalidate update feed //Invalidate update feed
\OC_Appconfig::setValue('core', 'lastupdatedat', 0); \OC_Appconfig::setValue('core', 'lastupdatedat', 0);
// only set the final version if everything went well
\OC_Config::setValue('version', implode('.', \OC_Util::getVersion()));
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment