Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-6273

PHP Notice -- undefined variable

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.9.6
    • 2.7.13
    • Module: Advanced forum
    • None
    • 2014121900
    • MOODLE_27_STABLE
    • MOODLE_29_STABLE

      Hi,

      I've found a notice from php. Just a undefined variable.

      Symptoms / How to reproduce

      After creating a forum and a discussion, on the discussion page, when we click on the link to return on the forum (the link beginning by "«"), we have a beautiful notice from php :

      Notice: Undefined variable: cm in /home/pedagroot/Documents/moodleBase/mod/hsuforum/view.php on line 59

      Possible fixes

      1. (Simplest) Replace the `!$cm` by `empty($cm)` (line 59)
      2. (Better) Remove the `if` lines 59 to 61, then add between the actual line 40 and 41 the following lines :

          if (!$cm = get_coursemodule_from_instance("forumimproved", $forum->id, $course->id)) {
              print_error('missingparameter');
          }
      

            Unassigned Unassigned
            jbparm Jean-Baptiste PARMENTIER
            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.