-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
2.3, 2.3.1
-
MOODLE_23_STABLE
-
MDL-34918_mod_assign_property_of_non-object
The signature for the get_form_elements method is: get_form_elements($grade, MoodleQuickForm $mform, stdClass $data).
The method expects that the first parameter, $grade, is a stdClass that contains information about the grade. However, $grade actually contains a string with a link to the gradebook. This is caused by a variable name that is incorrectly reused in mod/assign/locallib.php.
This bug causes feedback plugins to not be able to change feedback from the grade view, since the plugin can't retrieve the id of the already existing grade.
Replication steps:
You need a course with a student and developer error reporting enabled.
As a teacher:
1. Create a new assignment. Enable a feedback plugin, for example feedback comments.
2. Open the newly created assignment.
3. Click on "View/grade all submissions".
4. Open the (non-quick) grade view for an arbitrary student.
5. A notice "Notice: Trying to get property of non-object in [www-root]/mod/assign/feedback/[feedback plugin]/locallib.php on line 137"
6. Save a grade and feedback for the student.
7. Re-open the grade view for the student. The given feedback is missing.
- duplicates
-
MDL-34543 New assignment module - Feedback file exists for an assignment but not shown in the Feedback files picker
-
- Closed
-