Fatal error: Call to a member function is_excluded() on a non-object in /lib/grade/grade_grade.php on line 639

Fatal error: Call to a member function is_excluded() on a non-object in /lib/grade/grade_grade.php on line 639

by James Henestofel -
Number of replies: 4

Moodle 2.2.4+ (Build: 20120712)

Just got a call from an instructor saying that they are getting the word 'error' for the course total.  When they try to look at the user report they get a blank screen.

When I turn debugging on I get the below.

Notice: Undefined offset: 20554 in /lib/grade/grade_grade.php on line 634
Notice: Trying to get property of non-object in /lib/grade/grade_grade.php on line 634
Notice: Undefined offset: 20564 in /lib/grade/grade_grade.php on line 634
Notice: Trying to get property of non-object in /lib/grade/grade_grade.php on line 634
Notice: Undefined offset: 20554 in /lib/grade/grade_grade.php on line 639
Fatal error: Call to a member function is_excluded() on a non-object in /lib/grade/grade_grade.php on line 639

I can provide more info if needed.  Just wanted to get this out there in case someone else had an issue like this.

In reply to James Henestofel

Re: Fatal error: Call to a member function is_excluded() on a non-object in /lib/grade/grade_grade.php on line 639

by James Henestofel -

I'm still trying to debug this issue.  ANY help is appreciated.  If possible I can provide a partial dump of my database to help with debugging.

The course that I'm having the issue with has the id of 2669.  The teacher said they used the import process from a course with the id of 3081.

From the 'mdl_grade_items' table I pulled all instances of the 'courseid' of 2669.  The undefined offset above is trying to pull 'mdl_grade_item's from that script with the 'itemid' of 20554.  In the 'mdl_grade_items' data for the course of 2669 there is no 'id' of 20554.  Why is this course trying to pull 'item' data that isn't relevant to this course.

The item with id of 20554 or 20564 has a courseid of 3229.

In reply to James Henestofel

Re: Fatal error: Call to a member function is_excluded() on a non-object in /lib/grade/grade_grade.php on line 639

by Nic Ruley -

Did you ever find the answer to this? I actually just had a near identical problem in the grader report (gradebook) and it's only happening in one section that worked perfectly fine this morning.

Let me know if you found anything out.

 

 

In reply to Nic Ruley

Re: Fatal error: Call to a member function is_excluded() on a non-object in /lib/grade/grade_grade.php on line 639

by James Henestofel -

I never actually figured out what went wrong.  I had to fix it ASAP because it was a live course.  What I did to fix my issue was backup and restore the course as it was.  Whatever the backup and restore process did, it fixed the errors.

I would say if you still have the issue occurring and can possibly leave it for debugging you should create a tracker issue.  Otherwise I'm not sure what the issue was and how exactly it was fixed.

In reply to James Henestofel

Re: Fatal error: Call to a member function is_excluded() on a non-object in /lib/grade/grade_grade.php on line 639

by Andrew Ruether -

I also just ran into this problem in Moodle 2.4.  I'm using a "Grader" role for student graders.  One grader receives this error, but the others do not.