Skip to content

Commit

Permalink
MDL-50935 atto_equation: Add upgrade step to fix existing sites
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Nov 7, 2022
1 parent d474d4f commit 1a35908
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions lib/editor/atto/plugins/equation/db/upgrade.php
Expand Up @@ -47,5 +47,15 @@ function xmldb_atto_equation_upgrade($oldversion) {
// Automatically generated Moodle v4.0.0 release upgrade line.
// Put any upgrade step following this.

if ($oldversion < 2022041901) {
$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, 2022041901, 'atto', 'equation');
}

return true;
}
2 changes: 1 addition & 1 deletion lib/editor/atto/plugins/equation/version.php
Expand Up @@ -24,6 +24,6 @@

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

$plugin->version = 2022041900; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2022041901; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2022041200; // Requires this Moodle version.
$plugin->component = 'atto_equation'; // Full name of the plugin (used for diagnostics).

0 comments on commit 1a35908

Please sign in to comment.