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

Error in Single View grade report when last viewed grade item is deleted

XMLWordPrintable

      The code where the error occurs is in the switch of $itemtype in the file /grade/report/singleview/index.php.

      Steps to reproduce the error:

      • Create a course with an Assignment (any graded activity or resource).
      • Go to Grades, switch the view to Single View, filter in VIEW BY as Grade items, and select the assignment you just created.
      • Return to the course, delete this assignment, and wait for the adhoc task to be executed (or run it via CLI).
      • Once the assignment is deleted, if you go back to the Grades section, you won’t see the error yet, as the switch in index.php goes to case: "grade". Since the $itemid doesn’t exist in $gtree, it changes $itemtype to 'grade_select'.
      • However, if you refresh or re-enter, the switch will go to case "grade_select", and you’ll see the error, as we have the $lastviewedgradeitemid but that item no longer exists in the course.

      The $lastviewedgradeitemid is saved on the session.

            andrew.gosali@moodle.com Andrew Gosali
            miquel.gibert.garcia Miquel Gibert García
            Luca Bösch Luca Bösch
            Mihail Geshoski Mihail Geshoski
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 5 hours, 24 minutes
                5h 24m

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