After restoring a course with grade categories, we're no longer able to access the gradebook with the message
Found more than one record in fetch() !
More information about this error
Stack trace:
line 429 of /lib/setuplib.php: moodle_exception thrown
line 146 of /lib/grade/grade_object.php: call to print_error()
line 316 of /lib/grade/grade_item.php: call to grade_object::fetch_helper()
line 947 of /lib/grade/grade_item.php: call to grade_item::fetch()
line 1004 of /lib/gradelib.php: call to grade_item::fetch_course_item()
line 100 of /grade/report/grader/index.php: call to grade_regrade_final_grades()
Upon further investigation we have found multiple copies in grade_items table with 'course' type for that course.
Also in grade_categories table there are two toplevel categories listed for the course. (there was a singe subcategory in the original course).
If we remove the duplicate rows in each table we get access to the gradebook but not the "Simple View" or "Full View" of the gradebook categories page.
This is the error:
Fatal error: Call to a member function is_aggregationcoef_used() on a non-object in /var/www/moodle/lib/grade/grade_item.php on line 1993
Also accessing Quizzes seems to be affected as well:
When trying to access Quiz:
Found more than one record in fetch() !
More information about this error
Stack trace:
line 429 of /lib/setuplib.php: moodle_exception thrown
line 146 of /lib/grade/grade_object.php: call to print_error()
line 316 of /lib/grade/grade_item.php: call to grade_object::fetch_helper()
line 947 of /lib/grade/grade_item.php: call to grade_item::fetch()
line 352 of /lib/gradelib.php: call to grade_item::fetch_course_item()
line 686 of /mod/quiz/lib.php: call to grade_get_grades()
line 1175 of /mod/quiz/lib.php: call to quiz_grade_item_update()
line 121 of /mod/quiz/lib.php: call to quiz_after_add_or_update()
line 410 of /course/modedit.php: call to quiz_add_instance()
- duplicates
-
MDL-27395 Cannot restore Moodle 2.02 backups containing gradebook categories
-
- Closed
-