Skip to content

Commit

Permalink
MDL-34629 wiki: convert default format value during restore
Browse files Browse the repository at this point in the history
  • Loading branch information
mackensen committed Jul 30, 2012
1 parent d71b79a commit 94efded
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mod/wiki/backup/moodle1/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ public function get_paths() {
* data available
*/
public function process_wiki($data) {
global $CFG; // We need to check a config setting.

if (!empty($data['initialcontent'])) {
//convert file in <INITIALCONTENT>filename</INITIALCONTENT> into a subwiki page if no entry created.
$temppath = $this->converter->get_tempdir_path();
Expand Down Expand Up @@ -168,6 +170,12 @@ public function process_wiki($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;
}

// we now have all information needed to start writing into the file
$this->open_xml_writer("activities/wiki_{$this->moduleid}/wiki.xml");
$this->xmlwriter->begin_tag('activity', array('id' => $instanceid, 'moduleid' => $this->moduleid,
Expand Down

0 comments on commit 94efded

Please sign in to comment.