From e2e9cb6a1451cccdf2bf7000f5082c696148d97c Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Fri, 13 Sep 2013 10:28:52 +1000 Subject: [PATCH] MDL-37028 Fixed bug, orphaned modules are moved to the 0-section --- course/lib.php | 2 +- course/tests/courselib_test.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/course/lib.php b/course/lib.php index 6025325589a..50494d5e5e2 100644 --- a/course/lib.php +++ b/course/lib.php @@ -949,7 +949,7 @@ function course_integrity_check($courseid, $rawmods = null, $sections = null, $f } $sections[$modsection[$cmid]]->newsequence = trim($sections[$modsection[$cmid]]->newsequence.','.$cmid, ','); $messages[] = $debuggingprefix.'Course module ['.$cmid.'] is missing from sequence of section ['. - $sectionid.']'; + $modsection[$cmid].']'; } } foreach ($modsection as $cmid => $sectionid) { diff --git a/course/tests/courselib_test.php b/course/tests/courselib_test.php index 1c19a156302..a890de285f1 100644 --- a/course/tests/courselib_test.php +++ b/course/tests/courselib_test.php @@ -1866,7 +1866,7 @@ class core_course_courselib_testcase extends advanced_testcase { $DB->update_record('course_sections', array('id' => $section1->id, 'sequence' => '')); $this->assertEquals(array( 'Failed integrity check for course ['. $course->id. ']. Course module ['. $page->cmid. - '] is missing from sequence of section ['. $section1->id. ']', + '] is missing from sequence of section ['. $section0->id. ']', 'Failed integrity check for course ['. $course->id. ']. Course module ['. $page->cmid. '] points to section [8765] instead of ['. $section0->id. ']'), course_integrity_check($course->id, null, null, true));