From 2583805c6870865f8a097f32c00fa2878d21c9da Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Fri, 22 Jul 2022 09:06:08 +0800 Subject: [PATCH 1/7] MDL-76866 editor_tiny: make tiny default editor --- lib/db/install.php | 2 +- lib/editor/tiny/db/install.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/db/install.php b/lib/db/install.php index 153d3b0b199..a6841848db2 100644 --- a/lib/db/install.php +++ b/lib/db/install.php @@ -129,7 +129,7 @@ function xmldb_main_install() { 'sessiontimeout' => 8 * 60 * 60, // Must be present during roles installation. 'stringfilters' => '', // These two are managed in a strange way by the filters. 'filterall' => 0, // setting page, so have to be initialised here. - 'texteditors' => 'atto,tinymce,textarea', + 'texteditors' => 'tiny,atto,tinymce,textarea', 'antiviruses' => '', 'media_plugins_sortorder' => 'videojs,youtube', 'upgrade_extracreditweightsstepignored' => 1, // New installs should not run this upgrade step. diff --git a/lib/editor/tiny/db/install.php b/lib/editor/tiny/db/install.php index fe0fb6ca9a6..7e348774278 100644 --- a/lib/editor/tiny/db/install.php +++ b/lib/editor/tiny/db/install.php @@ -23,9 +23,9 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ - /** - * Post installation procedure for the TinyMCE editor. - */ +/** + * Enable the TinyMCE Editor on its install. + */ function xmldb_editor_tiny_install(): void { $editormanager = \core_plugin_manager::resolve_plugininfo_class('editor'); $editormanager::enable_plugin('tiny', true); From 4782312411a958f30fd07274efde341b57723e63 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Fri, 17 Mar 2023 10:09:57 +0800 Subject: [PATCH 2/7] MDL-76866 editor_atto: Remove old install script This install script has not been required for a number of years because we require the previous LTS for an LTS+1 upgrade. Once Atto was part of core after an LTS release, it was safe to remove this file. This is now preventing Tiny from becoming default for new installs in some situations. --- lib/editor/atto/db/install.php | 50 ---------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 lib/editor/atto/db/install.php diff --git a/lib/editor/atto/db/install.php b/lib/editor/atto/db/install.php deleted file mode 100644 index ad890400d96..00000000000 --- a/lib/editor/atto/db/install.php +++ /dev/null @@ -1,50 +0,0 @@ -. - -/** - * Atto upgrade script. - * - * @package editor_atto - * @copyright 2014 Damyon Wiese - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ - -defined('MOODLE_INTERNAL') || die(); - -/** - * Make the Atto the default editor for upgrades from 26. - * - * @return bool - */ -function xmldb_editor_atto_install() { - global $CFG; - - // Make Atto the default. - $currenteditors = $CFG->texteditors; - $neweditors = array(); - - $list = explode(',', $currenteditors); - array_push($neweditors, 'atto'); - foreach ($list as $editor) { - if ($editor != 'atto') { - array_push($neweditors, $editor); - } - } - - set_config('texteditors', implode(',', $neweditors)); - - return true; -} From 96fd7a83fbd82735c65373dc3d4cd944ae84eb85 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Wed, 22 Mar 2023 10:00:43 +0800 Subject: [PATCH 3/7] MDL-76866 mod_data: Editors should have data-fieldtype attrib --- mod/data/field/textarea/field.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/mod/data/field/textarea/field.class.php b/mod/data/field/textarea/field.class.php index 1413fe48662..0857e2427db 100644 --- a/mod/data/field/textarea/field.class.php +++ b/mod/data/field/textarea/field.class.php @@ -185,6 +185,7 @@ class data_field_textarea extends data_field_base { $str .= ''; $str .= '
'; $str .= '
'; $str .= '
'; $str .= '