We have a course with a glossary, but when producing the "New glossary entries:" section of the "Recent Activity" box on the front page of the course, PHP logs an error and aborts.
The error logged is:
[10-Mar-2011 11:23:57] PHP Catchable fatal error: Object of class moodle_url could not be converted to string in /usr/local/www/moodle/mod/glossary/lib.php on line 314
Line 314 reads:
echo '<div class="info"><a href="'.$link.'">'.format_text($entry->concept, true).'</a></div>';
The $link variable was instantiated a few lines prior to that as a moodle_url object:
$link = new moodle_url($CFG->wwwroot.'/mod/glossary/view.php' , $urlparams);
My response to the error message is to use $link->out() instead of $link (see attached patch), and that seems to work. Is there a better way to fix the problem?
- has been marked as being related by
-
MDL-22970 Glossary import displays too many items in recent activity
-
- Closed
-