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

mod_assign: bad conditional in get_assign_feedback_status_renderable

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 3.1
    • Assignment
    • 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:

      1. Create an assignment
      2. Manually delete the grade_items record for that assignment
      3. View the assignment in debug mode
        Note: The notice will be hidden under the navbar if the theme is Boost.

            Unassigned Unassigned
            jaked Jake Dallimore
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.