-
Bug
-
Resolution: Fixed
-
Minor
-
1.9.1
-
None
-
MOODLE_19_STABLE
-
MOODLE_19_STABLE
When creating or updating a rating for a database entry, I receive:
Notice: Undefined property: stdClass::$cmidnumber in /home/arborrow/Moodle/code/19stable/mod/data/lib.php on line 798
Looking into this, I see a couple of calls to grab the cmidnumber in some of the queries in /mod/data/lib.php. At the very least, I think we should check for it being set before attempting to use it. I will attach a patch for that check; however, it does seem that there is a little inconsistency in terms of what is being passed using the $data variable where sometimes it is just the record from mdl_data and other times it includes information from the course modules table (as in the data_update_grades function) where the sql statement is defined as:
$sql = "SELECT d.*, cm.idnumber as cmidnumber
FROM {$CFG->prefix}data d, {$CFG->prefix}course_modules cm, {$CFG->prefix}modules m
WHERE m.name='data' AND m.id=cm.module AND cm.instance=d.id";
I'm also attaching an xdebug of the page with an error. Since this is a little difficult to trap, because of the continue refresh, I'm including a modified html file removing the refresh metatag and and javascript. I have zipped the html file and the subfolder with the various js files.
Peace - Anthony
- has a non-specific relationship to
-
MDL-12961 Forum: Rating triggers undefined property error - cmidnumber
-
- Closed
-