From fde2e1cb6dc9399e31a2138a0ea912817f912701 Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Thu, 1 May 2014 14:00:40 +0800 Subject: [PATCH] MDL-45365 Courselib unit tests: cmid -> instanceid confusion Yet again an instanceid is being passed instead of a cmid. --- course/tests/courselib_test.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/course/tests/courselib_test.php b/course/tests/courselib_test.php index 1a95fccf68b60..dd4b6556b49b0 100644 --- a/course/tests/courselib_test.php +++ b/course/tests/courselib_test.php @@ -137,7 +137,8 @@ private function assign_create_run_asserts($moduleinfo, $dbmodinstance) { // The goal not being to fully test assign_add_instance() we'll stop here for the assign tests - to avoid too many DB queries. // Advanced grading. - $contextmodule = context_module::instance($dbmodinstance->id); + $cm = get_coursemodule_from_instance('assign', $dbmodinstance->id); + $contextmodule = context_module::instance($cm->id); $advancedgradingmethod = $DB->get_record('grading_areas', array('contextid' => $contextmodule->id, 'activemethod' => $moduleinfo->advancedgradingmethod_submissions));