Skip to content

Commit

Permalink
MDL-34612 forum: convert default format value during restore
Browse files Browse the repository at this point in the history
  • Loading branch information
mackensen committed Oct 8, 2013
1 parent 56cc9b3 commit 3ed2c6e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mod/forum/backup/moodle1/lib.php
Expand Up @@ -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);
Expand All @@ -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,
Expand Down

0 comments on commit 3ed2c6e

Please sign in to comment.