MDL-59076 format_weeks: if 'enddate' does not exist in backup then use 0

This commit is contained in:
Mark Nelson
2017-06-06 12:42:36 +08:00
parent f41c1f82bc
commit 6e34867b93
@@ -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.