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

Forum "ID Number" field changes when a forum post is rated

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Critical Critical
    • None
    • 1.9.7
    • Forum, Gradebook
    • None
    • MySQL
    • MOODLE_19_STABLE

      Hi,

      This issue is closely related to MDL-22181 (it's a similiar bug, but this time in the forum module)

      A brief description:

      My school uses the "ID number" field on assignments and activities to match gradeables in moodle to gradeables in our SIS. This allows us to export marks from moodle to the SIS smoothly. The bug that has arisen is that if we have assigned an ID string in the "ID number" field in the "Common module settings" section of a forum activity, when postings on that forum are rated, the "ID number" field of the corresponding entry in the gradebook is replaced by a number. For example if we have a forum with the ID Number field set to "Discussion 1", every time a post on that forum is rated the ID number field of the forum activity in the gradebook (as accessed through the edit icon in the "Categories and Items – Simple view" page) will be changed from "Discussion 1" to "34526" (or some other number). The number it's being changed to is the value of the id field corresponding to the forum object in the mdl_course_modules table.

      This seems to be the same sort of problem I reported in MDL-22181, only this time on the forum module. I've tracked down the error to the following lines:

      1) Line #23 in mod/forum/rate.php

      20 if (!$cm = get_coursemodule_from_instance('forum', $forum->id))

      { 21 error("Course Module ID was incorrect"); 22 }

      else

      { 23 $forum->cmidnumber = $cm->id; //MDL-12961 24 }

      line 23 should be: $forum->cmidnumber = $cm->idnumber; //MDL-12961

      2) Line #86 in mod/forum/rate_ajax.php

      82 /// Check coursemodule
      83 if (!$cm = get_coursemodule_from_instance('forum', $forum->id))

      { 84 print_error('invalidcoursemodule'); 85 }

      else

      { 86 $forum->cmidnumber = $cm->id; //MDL-12961 87 }

      line 86 should be: $forum->cmidnumber = $cm->idnumber; //MDL-12961

      I've tested this change on my testing server and it appears to solve the issue.

      -Gord

            andyjdavis Andrew Davis
            gbridge Gordon Bridge (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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