From 482de4e3707c0a10fc63ea56892ef20aeb278ae3 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Thu, 25 Aug 2022 22:27:11 +0800 Subject: [PATCH] MDL-75909 mod_data: Make template editor use html editor When the template editor is configured to use the HTML Editor, it should indicate this to Behat by setting the `data-fieldtype` to "editor". This indicates to the behat field manager that the editor is in use, which ensures that the correct value setting can take place. This is important in the context of MDL-75887. --- mod/data/templates.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mod/data/templates.php b/mod/data/templates.php index 73873a29ac5..59260ce248d 100644 --- a/mod/data/templates.php +++ b/mod/data/templates.php @@ -183,8 +183,10 @@ if (($mode === 'csstemplate') || ($mode === 'jstemplate')) { $usehtmleditor = data_get_config($data, "editor_{$mode}", true); } +$datafieldtype = ''; if ($usehtmleditor) { $format = FORMAT_HTML; + $datafieldtype = ' data-fieldtype="editor" '; } else { $format = FORMAT_PLAIN; } @@ -226,7 +228,7 @@ if ($mode == 'listtemplate'){ $field = 'listtemplateheader'; $editor->set_text($data->listtemplateheader); $editor->use_editor($field, $options); - echo '
'; echo ''; @@ -344,7 +346,7 @@ $field = 'template'; $editor->set_text($data->{$mode}); $editor->use_editor($field, $options); echo '
'; -echo ''; echo '
'; echo ''; @@ -360,7 +362,7 @@ if ($mode == 'listtemplate'){ $editor->set_text($data->listtemplatefooter); $editor->use_editor($field, $options); echo '
'; - echo ''; echo '
'; echo ''; @@ -377,7 +379,7 @@ if ($mode == 'listtemplate'){ $editor->set_text($data->rsstitletemplate); $editor->use_editor($field, $options); echo '
'; - echo ''; echo '
'; echo '';