MDL-50935 atto_equation: Add upgrade step to fix existing sites

This commit is contained in:
Jun Pataleta
2022-11-07 15:15:40 +08:00
parent 2d08d7d2c0
commit b490d511d6
2 changed files with 11 additions and 1 deletions
@@ -50,5 +50,15 @@ function xmldb_atto_equation_upgrade($oldversion) {
// Automatically generated Moodle v3.11.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2021051701) {
$oldmatrix = '\left| \begin{matrix} a_1 & a_2 \\ a_3 & a_4 \end{matrix} \right|';
$fixedmatrix = '\left| \begin{matrix} a_1 & a_2 \\\\ a_3 & a_4 \end{matrix} \right|';
$config = get_config('atto_equation', 'librarygroup4');
$newdefault = str_replace($oldmatrix, $fixedmatrix, $config);
set_config('librarygroup4', $newdefault, 'atto_equation');
// Atto equation savepoint reached.
upgrade_plugin_savepoint(true, 2021051701, 'atto', 'equation');
}
return true;
}
+1 -1
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2021051700; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2021051701; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2021051100; // Requires this Moodle version.
$plugin->component = 'atto_equation'; // Full name of the plugin (used for diagnostics).