Any attempts to access grades from this course results in:
Fatal error: Call to undefined method stdClass::generate_grades() in var/www/html/lib/grade/grade_item.php on line 658
In most of my recent tests I have discovered that the issue was caused by dupicate grade category item in this case
you can easily see in mdl_grade_items.id=34013, iteminstance=10182, itemtype='category' does not exist within courseid=8759
After removing the bogus id from mdl_grade_items the Gradebook then becomes operational.
mysql> select * from mdl_grade_categories where courseid=8759;
---------------------------------------------------------------------------------------------------------------------------------------------------------+
| id |
courseid |
parent |
depth |
path |
fullname |
aggregation |
keephigh |
droplow |
aggregateonlygraded |
aggregateoutcomes |
aggregatesubcats |
timecreated |
timemodified |
---------------------------------------------------------------------------------------------------------------------------------------------------------+
| 2213 |
8759 |
NULL |
1 |
/2213/ |
? |
10 |
0 |
0 |
0 |
0 |
0 |
1219100492 |
1229371179 |
| 10176 |
8759 |
2213 |
2 |
/2213/10176/ |
Exam 1 |
11 |
0 |
0 |
1 |
0 |
0 |
1229371157 |
1229371158 |
| 10178 |
8759 |
2213 |
2 |
/2213/10178/ |
Exam 2 |
11 |
0 |
0 |
1 |
0 |
0 |
1229371168 |
1229371168 |
| 10179 |
8759 |
2213 |
2 |
/2213/10179/ |
Short Paper |
11 |
0 |
0 |
1 |
0 |
0 |
1229371178 |
1229371178 |
| 10180 |
8759 |
2213 |
2 |
/2213/10180/ |
Research Paper |
11 |
0 |
0 |
1 |
0 |
0 |
1229371193 |
1229371211 |
---------------------------------------------------------------------------------------------------------------------------------------------------------+
mysql> select * from mdl_grade_items where courseid=8759;
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| id |
courseid |
categoryid |
itemname |
itemtype |
itemmodule |
iteminstance |
itemnumber |
iteminfo |
idnumber |
calculation |
gradetype |
grademax |
grademin |
scaleid |
outcomeid |
gradepass |
multfactor |
plusfactor |
aggregationcoef |
sortorder |
display |
decimals |
hidden |
locked |
locktime |
needsupdate |
timecreated |
timemodified |
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 10242 |
8759 |
NULL |
NULL |
course |
NULL |
2213 |
NULL |
NULL |
NULL |
NULL |
1 |
100.00000 |
0.00000 |
NULL |
NULL |
0.00000 |
1.00000 |
0.00000 |
0.00000 |
1 |
0 |
NULL |
0 |
0 |
0 |
0 |
1219100492 |
1219100492 |
| 26007 |
8759 |
10176 |
Exam 1 |
mod |
assignment |
12110 |
0 |
NULL |
104917 |
NULL |
1 |
100.00000 |
0.00000 |
NULL |
NULL |
0.00000 |
1.00000 |
0.00000 |
0.00000 |
6 |
0 |
NULL |
0 |
0 |
0 |
0 |
1223489110 |
1229372318 |
| 27995 |
8759 |
10178 |
Exam 2 |
mod |
assignment |
12738 |
0 |
NULL |
|
NULL |
1 |
100.00000 |
0.00000 |
NULL |
NULL |
0.00000 |
1.00000 |
0.00000 |
0.00000 |
8 |
0 |
NULL |
0 |
0 |
0 |
0 |
1225718682 |
1229397647 |
| 32322 |
8759 |
2213 |
Vital Signs Paper |
mod |
assignment |
14007 |
0 |
NULL |
|
NULL |
1 |
100.00000 |
0.00000 |
NULL |
NULL |
0.00000 |
1.00000 |
0.00000 |
0.00000 |
2 |
0 |
NULL |
0 |
0 |
0 |
0 |
1228835636 |
1229530921 |
| 34005 |
8759 |
NULL |
NULL |
category |
NULL |
10176 |
NULL |
NULL |
NULL |
NULL |
1 |
100.00000 |
0.00000 |
NULL |
NULL |
0.00000 |
1.00000 |
0.00000 |
0.00000 |
5 |
0 |
NULL |
0 |
0 |
0 |
0 |
1229371157 |
1229372296 |
| 33698 |
8759 |
2213 |
Final Exam |
mod |
assignment |
14234 |
0 |
NULL |
|
NULL |
1 |
100.00000 |
0.00000 |
NULL |
NULL |
0.00000 |
1.00000 |
0.00000 |
0.00000 |
3 |
0 |
NULL |
0 |
0 |
0 |
0 |
1229353614 |
1229395053 |
| 33714 |
8759 |
2213 |
Participation |
mod |
assignment |
14236 |
0 |
NULL |
124872 |
NULL |
1 |
100.00000 |
0.00000 |
NULL |
NULL |
0.00000 |
1.00000 |
0.00000 |
0.00000 |
4 |
0 |
NULL |
0 |
0 |
0 |
0 |
1229358140 |
1229372296 |
| 34007 |
8759 |
NULL |
NULL |
category |
NULL |
10178 |
NULL |
NULL |
NULL |
NULL |
1 |
100.00000 |
0.00000 |
NULL |
NULL |
0.00000 |
1.00000 |
0.00000 |
0.00000 |
7 |
0 |
NULL |
0 |
0 |
0 |
0 |
1229371168 |
1229372318 |
| 34008 |
8759 |
NULL |
NULL |
category |
NULL |
10179 |
NULL |
NULL |
NULL |
NULL |
1 |
100.00000 |
0.00000 |
NULL |
NULL |
0.00000 |
1.00000 |
0.00000 |
0.00000 |
9 |
0 |
NULL |
0 |
0 |
0 |
0 |
1229371178 |
1229372340 |
| 34009 |
8759 |
NULL |
NULL |
category |
NULL |
10180 |
NULL |
NULL |
NULL |
NULL |
1 |
100.00000 |
0.00000 |
NULL |
NULL |
0.00000 |
1.00000 |
0.00000 |
0.00000 |
10 |
0 |
NULL |
0 |
0 |
0 |
0 |
1229371193 |
1229372341 |
| 34013 |
8759 |
NULL |
NULL |
category |
NULL |
10182 |
NULL |
NULL |
NULL |
NULL |
1 |
100.00000 |
0.00000 |
NULL |
NULL |
0.00000 |
1.00000 |
0.00000 |
0.00000 |
11 |
0 |
NULL |
0 |
0 |
0 |
0 |
1229371357 |
1229372362 |
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
11 rows in set (0.00 sec)
The file grade_object.patch is one suggested way of dealing with this issue!
Any attempts to access grades from this course results in:
Fatal error: Call to undefined method stdClass::generate_grades() in var/www/html/lib/grade/grade_item.php on line 658
In most of my recent tests I have discovered that the issue was caused by dupicate grade category item in this case
you can easily see in mdl_grade_items.id=34013, iteminstance=10182, itemtype='category' does not exist within courseid=8759
After removing the bogus id from mdl_grade_items the Gradebook then becomes operational.
mysql> select * from mdl_grade_categories where courseid=8759;
------
---------------------------------------------------------------------------------------------------------------------------------------------------+------
---------------------------------------------------------------------------------------------------------------------------------------------------+------
---------------------------------------------------------------------------------------------------------------------------------------------------+mysql> select * from mdl_grade_items where courseid=8759;
------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------11 rows in set (0.00 sec)
The file grade_object.patch is one suggested way of dealing with this issue!
---------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ mysql> select * from mdl_grade_items where courseid=8759; --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 11 rows in set (0.00 sec) The file grade_object.patch is one suggested way of dealing with this issue!