From bbc009f26c3d3460a1dd2fc41abff43613cf762a Mon Sep 17 00:00:00 2001 From: David Monllao Date: Tue, 17 Feb 2015 11:00:52 +0800 Subject: [PATCH] MDL-48543 filter_mathjaxloader: Fixing upgrade version --- filter/mathjaxloader/db/upgrade.php | 39 +++++++++++++++-------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/filter/mathjaxloader/db/upgrade.php b/filter/mathjaxloader/db/upgrade.php index fcbf7c1488d..34f27b429ae 100644 --- a/filter/mathjaxloader/db/upgrade.php +++ b/filter/mathjaxloader/db/upgrade.php @@ -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({ @@ -85,24 +103,7 @@ MathJax.Hub.Config({ 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; -- 2.43.0