MDL-27733 workshop: keep the phase deadlines during the 1.9 => 2.0 upgrade
[moodle.git] / mod / workshop / db / upgradelib.php
index 4b79846..4be7689 100644 (file)
@@ -210,6 +210,14 @@ function workshop_upgrade_transform_instance(stdClass $old) {
         $new->strategy = 'rubric';
         break;
     }
+    if ($old->submissionstart < $old->submissionend) {
+        $new->submissionstart = $old->submissionstart;
+        $new->submissionend   = $old->submissionend;
+    }
+    if ($old->assessmentstart < $old->assessmentend) {
+        $new->assessmentstart = $old->assessmentstart;
+        $new->assessmentend   = $old->assessmentend;
+    }
 
     return $new;
 }