MDL-35305 wiki: backup and restore files

Thanks to Tatsuya Shirai for the patch
This commit is contained in:
Marina Glancy 2014-03-28 10:26:01 +08:00
parent ad32dda90c
commit e9e9b197b3
2 changed files with 3 additions and 3 deletions

View File

@ -120,7 +120,7 @@ class backup_wiki_activity_structure_step extends backup_activity_structure_step
// Define file annotations
$wiki->annotate_files('mod_wiki', 'intro', null); // This file area hasn't itemid
$page->annotate_files('mod_wiki', 'attachments', 'id'); // This file area hasn't itemid
$subwiki->annotate_files('mod_wiki', 'attachments', 'id'); // This file area hasn't itemid
// Return the root element (wiki), wrapped into standard activity structure
return $this->prepare_activity_structure($wiki);

View File

@ -91,7 +91,7 @@ class restore_wiki_activity_structure_step extends restore_activity_structure_st
$newitemid = false;
}
$this->set_mapping('wiki_subwiki', $oldid, $newitemid);
$this->set_mapping('wiki_subwiki', $oldid, $newitemid, true);
}
protected function process_wiki_page($data) {
@ -174,6 +174,6 @@ class restore_wiki_activity_structure_step extends restore_activity_structure_st
protected function after_execute() {
// Add wiki related files, no need to match by itemname (just internally handled context)
$this->add_related_files('mod_wiki', 'intro', null);
$this->add_related_files('mod_wiki', 'attachments', 'wiki_page');
$this->add_related_files('mod_wiki', 'attachments', 'wiki_subwiki');
}
}