diff --git a/course/format/weeks/backup/moodle2/restore_format_weeks_plugin.class.php b/course/format/weeks/backup/moodle2/restore_format_weeks_plugin.class.php index fb70b62e599..e0ec9c80187 100644 --- a/course/format/weeks/backup/moodle2/restore_format_weeks_plugin.class.php +++ b/course/format/weeks/backup/moodle2/restore_format_weeks_plugin.class.php @@ -162,8 +162,11 @@ class restore_format_weeks_plugin extends restore_format_plugin { $data = $this->connectionpoint->get_data(); + // Backup may not include the end date, so set it to 0. + $enddate = isset($data['tags']['enddate']) ? $data['tags']['enddate'] : 0; + // Set the automatic end date setting and the course end date (if applicable). - $this->update_automatic_end_date($data['tags']['enddate']); + $this->update_automatic_end_date($enddate); if (isset($data['tags']['numsections'])) { // Update course sections visibility.