diff --git a/lib/adminlib.php b/lib/adminlib.php index e9360f0d0da..3563fde4fbc 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -2319,6 +2319,7 @@ class admin_setting_confightmleditor extends admin_setting_configtext { } $editor = editors_get_preferred_editor(FORMAT_HTML); + $editor->set_text($data); $editor->use_editor($this->get_id(), array('noclean'=>true)); return format_admin_setting($this, $this->visiblename, diff --git a/lib/deprecatedlib.php b/lib/deprecatedlib.php index 8c85c9d60bc..adef5fd4798 100644 --- a/lib/deprecatedlib.php +++ b/lib/deprecatedlib.php @@ -1003,6 +1003,7 @@ function print_textarea($unused, $rows, $cols, $width, $height, $name, $value='' editors_head_setup(); $editor = editors_get_preferred_editor(FORMAT_HTML); + $editor->set_text($value); $editor->use_editor($id, array('legacy'=>true)); $str .= "\n".''; diff --git a/mod/data/templates.php b/mod/data/templates.php index f2c0388d2f9..32fd7a93f9d 100644 --- a/mod/data/templates.php +++ b/mod/data/templates.php @@ -218,6 +218,7 @@ if ($mode == 'listtemplate'){ echo '
'; $field = 'listtemplateheader'; + $editor->set_text($data->listtemplateheader); $editor->use_editor($field, $options); echo '
'; @@ -315,6 +316,7 @@ if ($mode == 'listtemplate'){ } $field = 'template'; +$editor->set_text($data->{$mode}); $editor->use_editor($field, $options); echo '
'; echo ''; @@ -327,6 +329,7 @@ if ($mode == 'listtemplate'){ echo '
'; $field = 'listtemplatefooter'; + $editor->set_text($data->listtemplatefooter); $editor->use_editor($field, $options); echo '
'; echo ''; @@ -338,6 +341,7 @@ if ($mode == 'listtemplate'){ echo '
'; $field = 'rsstitletemplate'; + $editor->set_text($data->rsstitletemplate); $editor->use_editor($field, $options); echo '
'; echo ''; diff --git a/question/behaviour/rendererbase.php b/question/behaviour/rendererbase.php index 0397da02797..0197329af57 100644 --- a/question/behaviour/rendererbase.php +++ b/question/behaviour/rendererbase.php @@ -82,6 +82,7 @@ abstract class qbehaviour_renderer extends plugin_renderer_base { $commenttext = format_text($commenttext, $commentformat, array('para' => false)); + $editor->set_text($commenttext); $editor->use_editor($id, array('context' => $options->context)); $commenteditor = html_writer::tag('div', html_writer::tag('textarea', s($commenttext), diff --git a/question/type/essay/renderer.php b/question/type/essay/renderer.php index 222e2a44410..f8db5516dec 100644 --- a/question/type/essay/renderer.php +++ b/question/type/essay/renderer.php @@ -236,6 +236,7 @@ class qtype_essay_format_editor_renderer extends plugin_renderer_base { list($draftitemid, $response) = $this->prepare_response_for_editing( $name, $step, $context); + $editor->set_text($response); $editor->use_editor($id, $this->get_editor_options($context), $this->get_filepicker_options($context, $draftitemid));