MDL-86112 courseformat: avoid a JS error modal when marking as done
When viewing an "available but not shown" cm with self-completion set, then clicking the 'Mark as done' button in the activity header.
This commit is contained in:
+2
-2
@@ -105,8 +105,8 @@ class get_state extends external_api {
|
||||
}
|
||||
|
||||
foreach ($modinfo->cms as $cm) {
|
||||
if ($cm->is_visible_on_course_page() && $cm->is_of_type_that_can_display()) {
|
||||
// Only return this course module data if it's visible by current user on the course page.
|
||||
if (($cm->is_visible_on_course_page() || $cm->is_stealth()) && $cm->is_of_type_that_can_display()) {
|
||||
// Only return this course module data if it's accessible to the current user on the course page.
|
||||
$section = $sections[$cm->sectionnum];
|
||||
$cmstate = new $cmclass($courseformat, $section, $cm, istrackeduser: $istrackeduser);
|
||||
$result->cm[] = $cmstate->export_for_template($renderer);
|
||||
|
||||
Reference in New Issue
Block a user