diff --git a/backup/restore_check.html b/backup/restore_check.html index 350885d5ea4..ac35bedda1f 100644 --- a/backup/restore_check.html +++ b/backup/restore_check.html @@ -25,8 +25,8 @@ $course_header->course_fullname = $form1->fullname; //"update_FullName"; /// Roll dates only if the backup course has a start date /// (some formats like main page, social..., haven't it and rolling dates - /// from 0 produces crazy dates. MDL-10125 - if ($course_header->course_startdate) { + /// from 0 produces crazy dates. MDL-10125 and we have passed some custom startyear/month/day. MDL-12922 + if ($course_header->course_startdate && !empty($form1->startyear)) { $form1->startdate = make_timestamp($form1->startyear, $form1->startmonth, $form1->startday); $currentcoursestartdate = $course_header->course_startdate; $coursestartdatedateoffset = $form1->startdate - $currentcoursestartdate; diff --git a/backup/restore_form.html b/backup/restore_form.html index 8f806f681ee..704e37f7be0 100644 --- a/backup/restore_form.html +++ b/backup/restore_form.html @@ -294,6 +294,11 @@ function selectItemInCheckboxByName(formId, checkName, checked ) { echo ''; } echo ""; + } else { + /// If user cannot create course, prevent any change in startyear/month/day (so restore wont calculate any roll. MDL-12922 + echo ''; + echo ''; + echo ''; } //Line echo "