1
0
mirror of https://github.com/moodle/moodle.git synced 2025-05-08 17:26:13 +02:00

MDL-53660 mod_forum: Fix link decoding in single discussions

This only happens when user data is not included.
This commit is contained in:
Mark Nielsen 2016-03-30 13:54:00 -07:00 committed by Dan Poltawski
parent b611ade3ab
commit 9258045b9b

@ -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');
}
}