MDL-34627 feedback: Convert default format value during restore
authorCharles Fulton <mackensen@gmail.com>
Sat, 28 Jul 2012 20:43:10 +0000 (16:43 -0400)
committerDavid Monllao <davidm@moodle.com>
Mon, 1 Dec 2014 02:53:15 +0000 (10:53 +0800)
mod/feedback/backup/moodle1/lib.php

index bab9041..320e847 100644 (file)
@@ -85,6 +85,8 @@ class moodle1_mod_feedback_handler extends moodle1_mod_handler {
      * data available
      */
     public function process_feedback($data) {
      * data available
      */
     public function process_feedback($data) {
+        global $CFG;
+
         // get the course module id and context id
         $instanceid     = $data['id'];
         $cminfo         = $this->get_cminfo($instanceid);
         // get the course module id and context id
         $instanceid     = $data['id'];
         $cminfo         = $this->get_cminfo($instanceid);
@@ -99,6 +101,12 @@ class moodle1_mod_feedback_handler extends moodle1_mod_handler {
         $this->fileman->itemid   = 0;
         $data['intro'] = moodle1_converter::migrate_referenced_files($data['intro'], $this->fileman);
 
         $this->fileman->itemid   = 0;
         $data['intro'] = moodle1_converter::migrate_referenced_files($data['intro'], $this->fileman);
 
+        // Convert the introformat if necessary.
+        if ($CFG->texteditors !== 'textarea') {
+            $data['intro'] = text_to_html($data['intro'], false, false, true);
+            $data['introformat'] = FORMAT_HTML;
+        }
+
         // start writing feedback.xml
         $this->open_xml_writer("activities/feedback_{$this->moduleid}/feedback.xml");
         $this->xmlwriter->begin_tag('activity', array('id' => $instanceid, 'moduleid' => $this->moduleid,
         // start writing feedback.xml
         $this->open_xml_writer("activities/feedback_{$this->moduleid}/feedback.xml");
         $this->xmlwriter->begin_tag('activity', array('id' => $instanceid, 'moduleid' => $this->moduleid,