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

glossary_print_recent_activity() function causes PHP fatal error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 1.9.12
    • 1.9.11
    • Glossary
    • FreeBSD 8.1-RELEASE, PHP 5.3.5, Apache 2.2, MySQL 5.1.54
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE
    • Easy

      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?

            nebgor Aparup Banerjee
            drs David Siebörger (Inactive)
            Dongsheng Cai Dongsheng Cai
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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