-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
3.11.6, 4.0
-
MOODLE_311_STABLE, MOODLE_400_STABLE
Problem
If an activity is included in a course's completion criteria in a course with the Course completion status block and then the activity type is disabled at the site level, enrolled users encounter an Invalid course module ID error and cannot access the course until the block is removed or the module type is re-enabled.
Expected behavior
A site admin should be able disable activities without causing courses to be inaccessible.
Steps to reproduce
- In a course with at least one student, add any Activity and select it under condition: Activity Completion in the Course Completion criteria (I chose a chat)
- In the same course add the Course Completion Status block
- In site administration, under Plugins > Activity Modules > Manage Activities, disable the activity type.
- Return to the course and verify the activity is not present and cannot be deselected in the Completion Criteria settings
- Attempt to access the course with a student account and view the Invalid Course Module Error
Stack Trace
- line 242 of /lib/modinfolib.php: moodle_exception thrown
- line 2235 of /lib/modinfolib.php: call to course_modinfo->get_cm()
- line 1041 of /lib/completionlib.php: call to cm_info::create()
- line 156 of /completion/criteria/completion_criteria_activity.php: call to completion_info->get_data()
- line 269 of /completion/criteria/completion_criteria.php: call to completion_criteria_activity->review()
- line 112 of /blocks/completionstatus/block_completionstatus.php: call to completion_criteria->is_pending()
- line 341 of /blocks/moodleblock.class.php: call to block_completionstatus->get_content()
- line 235 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
- line 1222 of /lib/blocklib.php: call to block_base->get_content_for_output()
- line 1280 of /lib/blocklib.php: call to block_manager->create_block_contents()
- line 377 of /lib/blocklib.php: call to block_manager->ensure_content_created()
- line 4068 of /lib/outputrenderers.php: call to block_manager->region_has_content()
- line 54 of /theme/boost/layout/drawers.php: call to core_renderer->blocks()
- line 1472 of /lib/outputrenderers.php: call to include()
- line 1398 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
- line 234 of /course/view.php: call to core_renderer->header()
- duplicates
-
MDL-74520 Course Completion Report Can't Be Viewed if Required Module is Disabled
-
- Open
-