Issue Details (XML | Word | Printable)

Key: MDL-12961
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Petr Skoda
Reporter: Anthony Borrow
Votes: 0
Watchers: 0
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Forum: Rating triggers undefined property error - cmidnumber

Created: 13/Jan/08 12:54 PM   Updated: 17/Mar/08 08:29 AM
Return to search
Component/s: Forum
Affects Version/s: 1.9
Fix Version/s: 1.9

File Attachments: 1. File MDL-12961.diff (0.6 kB)


Participants: Anthony Borrow and Petr Skoda
Security Level: None
Resolved date: 17/Mar/08
Affected Branches: MOODLE_19_STABLE
Fixed Branches: MOODLE_19_STABLE


 Description  « Hide
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.


 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Anthony Borrow added a comment - 13/Jan/08 12:56 PM
Here's a suggested patch.

Anthony Borrow added a comment - 13/Jan/08 12:59 PM
The suggested patch simply adds the cmidnumber to $forum if it was able to find the course module. It seems like a logical place to put it. We may want to comment why we are adding it. Peace - Anthony

Petr Skoda added a comment - 17/Mar/08 08:29 AM
already committed some time ago, thanks for the patch and report!