MDL-27733 workshop: keep the phase deadlines during the 1.9 => 2.0 upgrade
authorDavid Mudrak <david@moodle.com>
Mon, 6 Jun 2011 13:40:56 +0000 (15:40 +0200)
committerDavid Mudrak <david@moodle.com>
Mon, 6 Jun 2011 15:36:32 +0000 (17:36 +0200)
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;
 }