Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-34612 forum: convert default format value during restore

  • Loading branch information...
commit b6a84b6fdd633819d29e94d0ba717564e5f2b8d7 1 parent 9844660
@mackensen mackensen authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 mod/forum/backup/moodle1/lib.php
View
8 mod/forum/backup/moodle1/lib.php
@@ -73,6 +73,8 @@ public function get_paths() {
* Converts /MOODLE_BACKUP/COURSE/MODULES/MOD/FORUM data
*/
public function process_forum($data) {
+ global $CFG;
+
// get the course module id and context id
$instanceid = $data['id'];
$cminfo = $this->get_cminfo($instanceid);
@@ -87,6 +89,12 @@ public function process_forum($data) {
$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 forum.xml
$this->open_xml_writer("activities/forum_{$this->moduleid}/forum.xml");
$this->xmlwriter->begin_tag('activity', array('id' => $instanceid, 'moduleid' => $this->moduleid,
Please sign in to comment.
Something went wrong with that request. Please try again.