Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-29297

Grade Categories cause gradebook error after backup/restore

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 2.0.3, 2.0.4
    • Backup, Gradebook
    • None
    • PostgreSQL
    • MOODLE_20_STABLE

      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()

            stronk7 Eloy Lafuente (stronk7)
            tdjones Trevor Jones
            Votes:
            6 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.