Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-34918

Incorrect parameter passed to get_form_elements() of a assignment feedback plugin.



    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3, 2.3.1
    • Fix Version/s: None
    • Component/s: Assignment
    • Labels:


      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.


          Issue Links



              • Assignee:
                damyon Damyon Wiese
                eriklundberg Erik Lundberg
                Component watchers:
                Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              • Votes:
                0 Vote for this issue
                0 Start watching this issue


                • Created: