Skip to content

Commit

Permalink
MDL-31355 mod_forum: backup and restore of duedate and cutoffdate fields
Browse files Browse the repository at this point in the history
  • Loading branch information
rezaies committed Apr 10, 2019
1 parent ceea2d2 commit 0556f39
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mod/forum/backup/moodle2/backup_forum_stepslib.php
Expand Up @@ -39,7 +39,7 @@ protected function define_structure() {
// Define each element separated

$forum = new backup_nested_element('forum', array('id'), array(
'type', 'name', 'intro', 'introformat',
'type', 'name', 'intro', 'introformat', 'duedate', 'cutoffdate',
'assessed', 'assesstimestart', 'assesstimefinish', 'scale',
'maxbytes', 'maxattachments', 'forcesubscribe', 'trackingtype',
'rsstype', 'rssarticles', 'timemodified', 'warnafter',
Expand Down
8 changes: 8 additions & 0 deletions mod/forum/backup/moodle2/restore_forum_stepslib.php
Expand Up @@ -62,6 +62,14 @@ protected function process_forum($data) {

// Any changes to the list of dates that needs to be rolled should be same during course restore and course reset.
// See MDL-9367.
if (!isset($data->duedate)) {
$data->duedate = 0;
}
$data->duedate = $this->apply_date_offset($data->duedate);
if (!isset($data->cutoffdate)) {
$data->cutoffdate = 0;
}
$data->cutoffdate = $this->apply_date_offset($data->cutoffdate);
$data->assesstimestart = $this->apply_date_offset($data->assesstimestart);
$data->assesstimefinish = $this->apply_date_offset($data->assesstimefinish);
if ($data->scale < 0) { // scale found, get mapping
Expand Down

0 comments on commit 0556f39

Please sign in to comment.