-
Bug
-
Resolution: Fixed
-
Minor
-
4.4.4, 4.5
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.