mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 09:26:35 +02:00
Merge branch 'MDL-46671-29' of https://github.com/pjking07/moodle
This commit is contained in:
commit
4c1a27c209
1 changed files with 6 additions and 1 deletions
|
@ -180,7 +180,12 @@ class info_module extends info {
|
||||||
if (is_object($cmorid)) {
|
if (is_object($cmorid)) {
|
||||||
$cmorid = $cmorid->id;
|
$cmorid = $cmorid->id;
|
||||||
}
|
}
|
||||||
$cm = $DB->get_record('course_modules', array('id' => $cmorid), '*', MUST_EXIST);
|
$cm = $DB->get_record('course_modules', array('id' => $cmorid));
|
||||||
|
if (!$cm) {
|
||||||
|
// In some error cases, the course module may not exist.
|
||||||
|
debugging('info_module::is_user_visible called with invalid cmid ' . $cmorid, DEBUG_DEVELOPER);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If requested, check user can access the course.
|
// If requested, check user can access the course.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue