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

Forum: Rating triggers undefined property error - cmidnumber

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.9
    • 1.9
    • Forum
    • None
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE

      When posting a rating with debugging turned to ALL I received the following PHP notice

      Notice: Undefined property: stdClass::$cmidnumber in /home/arborrow/Moodle/code/19stable/mod/forum/lib.php on line 1168

      This is caused because the forum_grade_item_update function in /mod/forum/lib.php expects the $forum variable to have a field $cmidnumber ( * @param object $forum object with extra cmidnumber). I traced this back to /mod/forum/rate.php and found that the extra cmidnumber field was not being added on prior to passing the variable to the forum_grade_item_update function.

      I'll attach one possible patch that I used to get around this.

            skodak Petr Skoda
            aborrow Anthony Borrow
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

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