Skip to content

Commit

Permalink
MOBILE-2104 Upgrade code to migrate settings
Browse files Browse the repository at this point in the history
  • Loading branch information
jleyva committed May 4, 2017
1 parent 415e38e commit 60bca2d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
24 changes: 24 additions & 0 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,29 @@ function xmldb_local_mobile_upgrade($oldversion) {

upgrade_plugin_savepoint(true, 2016102600, 'local', 'mobile');
}

if ($oldversion < 2017050401) {
// Update configs moved to core.
$forcelogout = get_config('local_mobile', 'forcelogout');
$disabledfeatures = get_config('local_mobile', 'disabledfeatures');
$custommenuitems = get_config('local_mobile', 'custommenuitems');
$customlangstrings = get_config('local_mobile', 'customlangstrings');

if (!empty($forcelogout)) {
set_config('forcelogout', $forcelogout, 'tool_mobile');
}
if (!empty($disabledfeatures)) {
set_config('disabledfeatures', $disabledfeatures, 'tool_mobile');
}
if (!empty($custommenuitems)) {
set_config('custommenuitems', $custommenuitems, 'tool_mobile');
}
if (!empty($customlangstrings)) {
set_config('customlangstrings', $customlangstrings, 'tool_mobile');
}

upgrade_plugin_savepoint(true, 2017050401, 'local', 'mobile');
}

return true;
}
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2017050400; // The current plugin version (Date: YYYYMMDDXX)
$plugin->version = 2017050401; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2017042100; // Requires this Moodle version.
$plugin->component = 'local_mobile'; // Full name of the plugin (used for diagnostics).
$plugin->maturity = MATURITY_STABLE;
Expand Down

0 comments on commit 60bca2d

Please sign in to comment.