Merge branch 'MDL-37563-23' of git://github.com/damyon/moodle into MOODLE_23_STABLE
authorSam Hemelryk <sam@moodle.com>
Mon, 21 Jan 2013 20:10:23 +0000 (09:10 +1300)
committerSam Hemelryk <sam@moodle.com>
Mon, 21 Jan 2013 20:10:23 +0000 (09:10 +1300)
mod/assign/upgradelib.php

index f50aac0..89f15a2 100644 (file)
@@ -156,6 +156,20 @@ class assign_upgrade_manager {
                 $gradingdefinitions = $DB->get_records('grading_definitions', array('areaid'=>$gradingarea->id));
             }
 
+            // Upgrade availability data.
+            $DB->set_field('course_modules_availability',
+                           'coursemoduleid',
+                           $newcoursemodule->id,
+                           array('coursemoduleid'=>$oldcoursemodule->id));
+            $DB->set_field('course_modules_availability',
+                           'sourcecmid',
+                           $newcoursemodule->id,
+                           array('sourcecmid'=>$oldcoursemodule->id));
+            $DB->set_field('course_sections_availability',
+                           'sourcecmid',
+                           $newcoursemodule->id,
+                           array('sourcecmid'=>$oldcoursemodule->id));
+
             // upgrade completion data
             $DB->set_field('course_modules_completion', 'coursemoduleid', $newcoursemodule->id, array('coursemoduleid'=>$oldcoursemodule->id));
             $allcriteria = $DB->get_records('course_completion_criteria', array('moduleinstance'=>$oldcoursemodule->id));