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

Course modules availability information not deleted on course deletion.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.3, 2.3
    • Fix Version/s: 2.2.4
    • Component/s: Conditional activities
    • Labels:
      None
    • Testing Instructions:
      Hide

      0. You must have completion options enabled on server.
      1. Create a new course with completion tracking enabled.
      2. Create a new Page with completion set to let students manually mark complete.
      3. In database, run this query:

      select count(*) from coremdl_course_modules_completion

      Where 'coremdl_' is your database prefix.
      Note the result, let's call it X. For example in my case, X = 125
      4. Turn editing off.
      5. Tick the ticky-box next to the Page
      6. Run the query again and note the result, let's call it Y. Y should be = X+1 (126 in my case)
      7. Do this database update to bust your page module:

      update coremdl_modules set name='frog' where name='page' 

      8. Delete the course by changing the URL in address bad from 'view.php' to 'delete.php'. Click continue.
      9. Repeat the first query. Call the result Z.

      Z should be = X (125 in my case) but due to this bug, before the fix it is actually = Y (126).

      Note: You may want to repair your page module at this point

      update coremdl_modules set name='page' where name='frog' 

      Show
      0. You must have completion options enabled on server. 1. Create a new course with completion tracking enabled. 2. Create a new Page with completion set to let students manually mark complete. 3. In database, run this query: select count(*) from coremdl_course_modules_completion Where 'coremdl_' is your database prefix. Note the result, let's call it X. For example in my case, X = 125 4. Turn editing off. 5. Tick the ticky-box next to the Page 6. Run the query again and note the result, let's call it Y. Y should be = X+1 (126 in my case) 7. Do this database update to bust your page module: update coremdl_modules set name='frog' where name='page' 8. Delete the course by changing the URL in address bad from 'view.php' to 'delete.php'. Click continue. 9. Repeat the first query. Call the result Z. Z should be = X (125 in my case) but due to this bug, before the fix it is actually = Y (126). Note: You may want to repair your page module at this point update coremdl_modules set name='page' where name='frog'
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE
    • Pull Master Branch:
      MDL-32988-master

      Description

      In lib/moodlelib.php the function remove_course_contents is responsible (obviously) for removing contents from the course on deletion. However, in 2.2 the course_modules are being deleted before the removal of the availability, meaning the availability is never removed as the course module no longer exists.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  9/Jul/12