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

Adding module on courses with completion enabled creates course_module section-id corruption

XMLWordPrintable

    • PostgreSQL
    • MOODLE_23_STABLE, MOODLE_25_STABLE
    • MOODLE_23_STABLE, MOODLE_24_STABLE
    • MDL-38173-master
    • Difficult
    • Hide

      Part 1 on 2.3 only - check adding a module works correctly

      1. On a clean install of moodle
      2. Turn on debugging
      3. Create a new course (will create 1 forum activity)
      4. Add a file to the second section of the course
      5. Verify in the database that the section column of the course_modules table is not the same for both modules.

      Part 2 - check upgrade works for 2.3, 2.4 and 2.5

      1. Install last weeks stable release of 2.3 (2012062504.10)
      2. Perform the steps listed in part 1 and but verify that the section column for both modules is the same (this is the bug)
      3. Upgrade to the integration version of 2.3
      4. Verify the upgrade completes and after the upgrade, that the section column of the course_modules table is not the same for both modules
      1. Install last weeks stable release of 2.3 (2012062504.10)
      2. Perform the steps listed in part 1 and but verify that the section column for both modules is the same (this is the bug)
      3. Upgrade to the integration version of 2.4
      4. Verify the upgrade completes and after the upgrade, that the section column of the course_modules table is not the same for both modules
      1. Install last weeks stable release of 2.3 (2012062504.10)
      2. Perform the steps listed in part 1 and but verify that the section column for both modules is the same (this is the bug)
      3. Upgrade to the integration version of master
      4. Verify the upgrade completes and after the upgrade, that the section column of the course_modules table is not the same for both modules
      Show
      Part 1 on 2.3 only - check adding a module works correctly On a clean install of moodle Turn on debugging Create a new course (will create 1 forum activity) Add a file to the second section of the course Verify in the database that the section column of the course_modules table is not the same for both modules. Part 2 - check upgrade works for 2.3, 2.4 and 2.5 Install last weeks stable release of 2.3 (2012062504.10) Perform the steps listed in part 1 and but verify that the section column for both modules is the same (this is the bug) Upgrade to the integration version of 2.3 Verify the upgrade completes and after the upgrade, that the section column of the course_modules table is not the same for both modules Install last weeks stable release of 2.3 (2012062504.10) Perform the steps listed in part 1 and but verify that the section column for both modules is the same (this is the bug) Upgrade to the integration version of 2.4 Verify the upgrade completes and after the upgrade, that the section column of the course_modules table is not the same for both modules Install last weeks stable release of 2.3 (2012062504.10) Perform the steps listed in part 1 and but verify that the section column for both modules is the same (this is the bug) Upgrade to the integration version of master Verify the upgrade completes and after the upgrade, that the section column of the course_modules table is not the same for both modules

      After MDL-37939 was applied, we began seeing corruption of modules moving to other courses. I added a number of comments related to that in the bug, but didn't understand the issue well enough to confirm it was caused by that fix. I have now confirmed that.

      When course completion enabled, you get two database updates on mdl_course_modules;

      UPDATE mdl_course_modules SET section = $2 WHERE id = $1
      parameters: $1 = '519934', $2 = '10931'
      UPDATE mdl_course_modules SET section = $2 WHERE id = $1
      parameters: $1 = '930004', $2 = '10931'

      The first one has the wrong value for id, updating a course_module that is wrong. That id is the instance of the module, not it's course_module.id.

            damyon Damyon Wiese
            mr-russ Russell Smith
            Dan Poltawski Dan Poltawski
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Frédéric Massart Frédéric Massart
            Votes:
            4 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved:

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