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

"Course Module ID Incorrect" on "view assignment submission" page.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • 1.9.8
    • Assignment (2.2)
    • moodle 1.9.8 (build 20100325)
      CentOS 5.4
      php 5.3.3
      mysql 5.1.54
    • MySQL
    • MOODLE_19_STABLE
    • Moderate

      This bug is from a mixup between (course module) id and instance id.

      This is related with these bugs, perhaps:

      MDL-12555 Course Module ID Incorrect on Advanced Search ...
      MDL-6701 "Course Module ID incorrect" error on any ...

      [STEPS]
      From a teacher's profile, go to:

      Activity Reports > All Logs

      On this creen, click any "View Assignment Submissions".
      It opens a popup window, but will say "Course Module ID was incorrect." (See screenshot.)
      https://[server]/mod/assignment/submissions.php?id=9999

      There is a "continue" button, but it brings the user to the course home screen, in the popup window.

      [OBSERVATION]
      The cause is because "id" passed to the page is that of a "course module instance id", but the page treats it as a "course module id".

      This is the captured sql statement run on the page, which returns nothing (therefore causing the message).

      SELECT cm.*, m.name, md.name as modname FROM mdl_course_modules cm,
      mdl_modules md, mdl_assignment m WHERE cm.id = 9999 AND cm.instance =
      m.id AND md.id = cm.module ;

      The sql should be changed to this:

      SELECT cm.*, m.name, md.name as modname FROM mdl_course_modules
      cm, mdl_modules md, mdl_assignment m WHERE m.id = 9999 AND cm.instance =
      m.id AND md.id = cm.module ;

      But, the problem is that the sql is from
      get_coursemodule_from_id
      which is defined in
      lib/datalib.php

      =============
      return get_record_sql("SELECT cm.*, m.name, md.name as modname
      FROM {$CFG->prefix}course_modules cm,
      {$CFG->prefix}modules md,
      {$CFG->prefix}$modulename m
      WHERE $courseselect
      cm.id = ".intval($cmid)." AND
      cm.instance = m.id AND
      md.name = '$modulename' AND
      md.id = cm.module");

            poltawski Dan Poltawski
            bkimcoe bkimcoe (Inactive)
            Votes:
            1 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.