From 299b5748eae65de797b631d5476dabd1f2088423 Mon Sep 17 00:00:00 2001 From: David Woloszyn Date: Mon, 6 Nov 2023 16:28:24 +1100 Subject: [PATCH] MDL-77325 core: Upgrades will make Tiny the default editor --- lib/db/upgrade.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index bc8185a855e..1b8fc5d510b 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -3682,5 +3682,21 @@ privatefiles,moodle|/user/files.php'; // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + if ($oldversion < 2023110200.00) { + // Reorder the editors to make Tiny the default for all upgrades. + $editors = []; + array_push($editors, 'tiny'); + $list = explode(',', $CFG->texteditors); + foreach ($list as $editor) { + if ($editor != 'tiny') { + array_push($editors, $editor); + } + } + set_config('texteditors', implode(',', $editors)); + + // Main savepoint reached. + upgrade_main_savepoint(true, 2023110200.00); + } + return true; }