MDL-20926 fixed fetching of cm
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
$type = optional_param('type', 'xls', PARAM_ALPHA);
|
||||
$group = optional_param('group', 0, PARAM_INT);
|
||||
|
||||
if (! $cm = get_record("course_modules", "id", $id)) {
|
||||
if (! $cm = get_coursemodule_from_id('survey', $id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
$id = required_param('id', PARAM_INT); // CM ID
|
||||
|
||||
|
||||
if (! $cm = get_record("course_modules", "id", $id)) {
|
||||
if (! $cm = get_coursemodule_from_id('workshop', $id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
}
|
||||
if (! $course = get_record("course", "id", $cm->course)) {
|
||||
|
||||
Reference in New Issue
Block a user