-
Bug
-
Resolution: Fixed
-
Major
-
3.11, 4.0
-
MOODLE_311_STABLE, MOODLE_400_STABLE
-
MOODLE_311_STABLE
-
MDL-71659-master-missinggradeitem -
-
If there are missing or duplicated grade items \completion_info::get_grade_completion() can throw errors when fetching grade completion data.
To replicate:
- Create a course with activity completion with "Show completion conditions" enabled.
- Enrol a teacher and/or a student.
- Create an assignment a1. Make sure to "Require grade" as part of its activity completion conditions.
- Delete or duplicate a1's record from the grade_items table.
- View the course.
Deleted grade
An internal error occurred in the completion system. (System administrators can enable debugging information to see more detail.)
|
|
More information about this error
|
|
×Debug info: Cannot find grade item for 'assign'
|
cm '2' matching number '0'
|
Error code: err_system
|
×Stack trace:
|
line 1514 of /lib/completionlib.php: moodle_exception thrown
|
line 774 of /lib/completionlib.php: call to completion_info->internal_systemerror()
|
line 1136 of /lib/completionlib.php: call to completion_info->get_grade_completion()
|
line 1111 of /lib/completionlib.php: call to completion_info->get_other_cm_completion_data()
|
line 68 of /completion/classes/cm_completion_details.php: call to completion_info->get_data()
|
line 273 of /completion/classes/cm_completion_details.php: call to core_completion\cm_completion_details->__construct()
|
line 88 of /course/classes/output/cm_format.php: call to core_completion\cm_completion_details::get_instance()
|
line 104 of /course/classes/output/section_format/cmitem.php: call to core_course\output\cm_format->export_for_template()
|
line 119 of /course/classes/output/section_format/cmlist.php: call to core_course\output\section_format\cmitem->export_for_template()
|
line 200 of /course/classes/output/section_format.php: call to core_course\output\section_format\cmlist->export_for_template()
|
line 157 of /course/classes/output/course_format.php: call to core_course\output\section_format->export_for_template()
|
line 84 of /course/classes/output/course_format.php: call to core_course\output\course_format->export_sections()
|
line 102 of /course/format/renderer.php: call to core_course\output\course_format->export_for_template()
|
line 60 of /course/format/topics/format.php: call to format_section_renderer_base->render()
|
line 278 of /course/view.php: call to require()
|
Duplicated grade
Found more than one record in fetch() !
|
|
More information about this error
|
|
×Debug info:
|
Error code: morethanonerecordinfetch
|
×Stack trace:
|
line 497 of /lib/setuplib.php: moodle_exception thrown
|
line 163 of /lib/grade/grade_object.php: call to print_error()
|
line 366 of /lib/grade/grade_item.php: call to grade_object::fetch_helper()
|
line 758 of /lib/completionlib.php: call to grade_item::fetch()
|
line 1136 of /lib/completionlib.php: call to completion_info->get_grade_completion()
|
line 1111 of /lib/completionlib.php: call to completion_info->get_other_cm_completion_data()
|
line 68 of /completion/classes/cm_completion_details.php: call to completion_info->get_data()
|
line 273 of /completion/classes/cm_completion_details.php: call to core_completion\cm_completion_details->__construct()
|
line 88 of /course/classes/output/cm_format.php: call to core_completion\cm_completion_details::get_instance()
|
line 104 of /course/classes/output/section_format/cmitem.php: call to core_course\output\cm_format->export_for_template()
|
line 119 of /course/classes/output/section_format/cmlist.php: call to core_course\output\section_format\cmitem->export_for_template()
|
line 200 of /course/classes/output/section_format.php: call to core_course\output\section_format\cmlist->export_for_template()
|
line 157 of /course/classes/output/course_format.php: call to core_course\output\section_format->export_for_template()
|
line 84 of /course/classes/output/course_format.php: call to core_course\output\course_format->export_sections()
|
line 102 of /course/format/renderer.php: call to core_course\output\course_format->export_for_template()
|
line 60 of /course/format/topics/format.php: call to format_section_renderer_base->render()
|
line 278 of /course/view.php: call to require()
|
Note that this is a pre-existing issue that affects older versions of Moodle. It just so happens that we're encountering this early now in 3.11 since we're fetching the details about the activities' completion information upon course load.
This problem with duplicated/deleted grade items can be encountered in 3.10 and below when the student visits an activity (e.g. an assignment) with deleted/duplicated grade item.
- Discovered while testing
-
MDLSITE-6438 Upgrade school.moodledemo.net to 3.11
- Resolved
- is a regression caused by
-
MDL-70815 Create a base class for fetching a user's activity completion details
- Closed
- will help resolve
-
MDLSITE-1816 Assignment issues with Mount Orange school demo
- Closed