Permalink
Browse files

MDL-37563 Assignment upgrade: Upgrade conditional activity settings.

Conflicts:

	mod/assign/upgradelib.php
  • Loading branch information...
1 parent 92a3802 commit 7a6d23ef25d4caf50b958c6e7a07cda103b9a801 @damyon damyon committed Jan 17, 2013
Showing with 14 additions and 0 deletions.
  1. +14 −0 mod/assign/upgradelib.php
@@ -156,6 +156,20 @@ public function upgrade_assignment($oldassignmentid, & $log) {
$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));

0 comments on commit 7a6d23e

Please sign in to comment.