MDL-55548 backup: changes after review
1) There is no need to store the 'timemodified' value of the section when backing up a course module, they do not refer to the same time. 2) When creating a new course section during restore use the current time. 3) Added timemodified value to more places when updating the 'course_sections' table.
This commit is contained in:
@@ -287,8 +287,12 @@ class condition extends \core_availability\condition {
|
||||
|
||||
// Save the updated course module.
|
||||
if ($changed) {
|
||||
$DB->set_field('course_sections', 'availability', json_encode($tree->save()),
|
||||
array('id' => $section->id));
|
||||
$updatesection = new \stdClass();
|
||||
$updatesection->id = $section->id;
|
||||
$updatesection->availability = json_encode($tree->save());
|
||||
$updatesection->timemodified = time();
|
||||
$DB->update_record('course_sections', $updatesection);
|
||||
|
||||
$anychanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user