-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
3.1
-
MOODLE_31_STABLE
This is just a minor issue that I noticed while testing MDL-56948, in which the test involved removing a grade_items record. This exposed some bad code in mod/assign/locallib.
Basically, this line results in a notice if the gradebookgrade is null.
assign->get_assign_feedback_status_renderable() |
|
4797
|
if ((!is_null($gradebookgrade->grade) || !$emptyplugins) |
4798
|
&& ($cangrade || !$gradebookgrade->hidden)) { |
We need to check for a null object before trying to check the property.
To replicate is hard. In MDL-56948, some users indicated they were seeing errors because of missing grade_items records, however, we couldn't replicate this, so the testing instructions were to remove a record for the respective activity manually. Perhaps, in the past, Moodle didn't create grade_items for activities with Grade Type set to 'None', hard to say. In any case, you can see this error by:
- Create an assignment
- Manually delete the grade_items record for that assignment
- View the assignment in debug mode
Note: The notice will be hidden under the navbar if the theme is Boost.