Merge branch 'MDL-53660-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE
This commit is contained in:
@@ -206,11 +206,17 @@ class restore_forum_activity_structure_step extends restore_activity_structure_s
|
||||
}
|
||||
|
||||
protected function after_execute() {
|
||||
global $DB;
|
||||
|
||||
// Add forum related files, no need to match by itemname (just internally handled context)
|
||||
$this->add_related_files('mod_forum', 'intro', null);
|
||||
|
||||
// Add post related files, matching by itemname = 'forum_post'
|
||||
$this->add_related_files('mod_forum', 'post', 'forum_post');
|
||||
$this->add_related_files('mod_forum', 'attachment', 'forum_post');
|
||||
}
|
||||
|
||||
protected function after_restore() {
|
||||
global $DB;
|
||||
|
||||
// If the forum is of type 'single' and no discussion has been ignited
|
||||
// (non-userinfo backup/restore) create the discussion here, using forum
|
||||
// information as base for the initial post.
|
||||
@@ -240,9 +246,5 @@ class restore_forum_activity_structure_step extends restore_activity_structure_s
|
||||
$fs->create_file_from_storedfile($newfilerecord, $file);
|
||||
}
|
||||
}
|
||||
|
||||
// Add post related files, matching by itemname = 'forum_post'
|
||||
$this->add_related_files('mod_forum', 'post', 'forum_post');
|
||||
$this->add_related_files('mod_forum', 'attachment', 'forum_post');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user