Skip to content

Commit

Permalink
MDL-48543 filter_mathjaxloader: Fixing upgrade version
Browse files Browse the repository at this point in the history
  • Loading branch information
David Monllao committed Feb 17, 2015
1 parent b1a55c5 commit bbc009f
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions filter/mathjaxloader/db/upgrade.php
Expand Up @@ -46,7 +46,25 @@ function xmldb_filter_mathjaxloader_upgrade($oldversion) {

// Moodle v2.8.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2015013000) {

if ($oldversion < 2015021200) {

$httpurl = get_config('filter_mathjaxloader', 'httpurl');
// Don't change the config if it has been manually changed to something besides the default setting value.
if ($httpurl === "http://cdn.mathjax.org/mathjax/2.3-latest/MathJax.js") {
set_config('httpurl', 'http://cdn.mathjax.org/mathjax/2.5-latest/MathJax.js', 'filter_mathjaxloader');
}

$httpsurl = get_config('filter_mathjaxloader', 'httpsurl');
// Don't change the config if it has been manually changed to something besides the default setting value.
if ($httpsurl === "https://cdn.mathjax.org/mathjax/2.3-latest/MathJax.js") {
set_config('httpsurl', 'https://cdn.mathjax.org/mathjax/2.5-latest/MathJax.js', 'filter_mathjaxloader');
}

upgrade_plugin_savepoint(true, 2015021200, 'filter', 'mathjaxloader');
}

if ($oldversion < 2015021700) {

$oldconfig = get_config('filter_mathjaxloader', 'mathjaxconfig');
$olddefault = 'MathJax.Hub.Config({
Expand Down Expand Up @@ -85,24 +103,7 @@ function xmldb_filter_mathjaxloader_upgrade($oldversion) {
set_config('mathjaxconfig', $newdefault, 'filter_mathjaxloader');
}

upgrade_plugin_savepoint(true, 2015013000, 'filter', 'mathjaxloader');
}

if ($oldversion < 2015021200) {

$httpurl = get_config('filter_mathjaxloader', 'httpurl');
// Don't change the config if it has been manually changed to something besides the default setting value.
if ($httpurl === "http://cdn.mathjax.org/mathjax/2.3-latest/MathJax.js") {
set_config('httpurl', 'http://cdn.mathjax.org/mathjax/2.5-latest/MathJax.js', 'filter_mathjaxloader');
}

$httpsurl = get_config('filter_mathjaxloader', 'httpsurl');
// Don't change the config if it has been manually changed to something besides the default setting value.
if ($httpsurl === "https://cdn.mathjax.org/mathjax/2.3-latest/MathJax.js") {
set_config('httpsurl', 'https://cdn.mathjax.org/mathjax/2.5-latest/MathJax.js', 'filter_mathjaxloader');
}

upgrade_plugin_savepoint(true, 2015021200, 'filter', 'mathjaxloader');
upgrade_plugin_savepoint(true, 2015021700, 'filter', 'mathjaxloader');
}

return true;
Expand Down

0 comments on commit bbc009f

Please sign in to comment.