From 4135409f08b320e60571e9ba9e99de436e0c69fc Mon Sep 17 00:00:00 2001 From: trevor-c Date: Tue, 19 Feb 2013 15:18:41 -0600 Subject: [PATCH] hack to fix course_module section info; ensure it matches sequence info --- lib/db/upgrade.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 0bee3c9..f70a2e8 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -1059,6 +1059,18 @@ function xmldb_main_upgrade($oldversion) { $section->sequence = $sequence; $DB->update_record('course_sections', $section); } + + // hack - cunnintr + // run through course_modules listed in sequence to be sure the course_module section info matches + foreach ($newsequence[$section->section] as $newseqentry) { + $checkcoursemodule = $DB->get_record('course_modules', array('id' => $newseqentry)); + if ($checkcoursemodule->section != $section->id) { + $checkcoursemodule->section = $section->id; + $DB->update_record('course_modules', $checkcoursemodule); + $clearcaches = true; + } + } + // end hack } if ($clearcaches) { -- 1.7.11.3