When adding a Glossary, the following notice is reported by PHP:
PHP Notice: Trying to get property of non-object in mod/glossary/lib.php on line 389
384 if(!empty($glossary->cmidnumber))
{ 385 $params = array('itemname'=>$glossary->name, 'idnumber'=>$glossary->cmidnumber); 386 }else
{ 387 // MDL-14303 388 $cm = get_coursemodule_from_instance('glossary', $glossary->id); 389 $params = array('itemname'=>$glossary->name, 'idnumber'=>$cm->id); 390 }For some reason, $cm comes back empty, so we get the error on line 389. Maybe for a new glossary the cm record hasn't been added yet?
I don't know how necessary it is to set idnumber, or whether it always needs to be set to the cm->id, but the following at least prevents the error from occurring
384 $params = array('itemname'=>$glossary->name);
385 if (array_key_exists('cmidnumber', $glossary))
Also, I was expecting to see an item in the grade book for each glossary, but there doesn't seem to be one. Again, maybe my understanding of how glossaries work may not be correct.
- has a non-specific relationship to
-
MDL-14303 Glossary: PHP error notice on sending ratings
-
- Closed
-