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

Integrity check the course module sequence/sections

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.6
    • 2.4, 2.5.2
    • Course
    • MOODLE_24_STABLE, MOODLE_25_STABLE
    • MOODLE_26_STABLE
    • wip-MDL-37028-master
    • Hide

      Test 1 (on-the-fly correction).

      1. Edit DB directly and artificially corrupt the course_modules/course_sections tables with one of the following way:
      • course_sections.sequence contains a module id twice throughout the course
      • course_sections.sequence contains module id and for the same module course_modules.section does not match the section id (note that autofix will think that section sequence is more important!)
      1. Edit anything in the course (for example, open /course/edit.php page and save even without making any changes) - this will result in rebuilding the cache and auto correction
      2. Make sure debugging messages appear
      3. Open DB and make sure that corruptions were automatically fixed.

      Test 2 (cli script).

      1. Corrupt DB as mentioned above or also you can:
      • have an orphaned module (no course_sections.sequence in the course references to it)
      • have some non-existing id in course_sections.sequence
      1. Run php admin/cli/fix_course_sequence.php
      2. Try running with different arguments and make sure it is understandable what script is doing.
      3. Finally run with --fix and make sure everything is fixed in DB.
      Show
      Test 1 (on-the-fly correction). Edit DB directly and artificially corrupt the course_modules/course_sections tables with one of the following way: course_sections.sequence contains a module id twice throughout the course course_sections.sequence contains module id and for the same module course_modules.section does not match the section id (note that autofix will think that section sequence is more important!) Edit anything in the course (for example, open /course/edit.php page and save even without making any changes) - this will result in rebuilding the cache and auto correction Make sure debugging messages appear Open DB and make sure that corruptions were automatically fixed. Test 2 (cli script). Corrupt DB as mentioned above or also you can: have an orphaned module (no course_sections.sequence in the course references to it) have some non-existing id in course_sections.sequence Run php admin/cli/fix_course_sequence.php Try running with different arguments and make sure it is understandable what script is doing. Finally run with --fix and make sure everything is fixed in DB.
    • BACKEND Sprint 4

      As I discovered in MDLSITE-1938, its possible to get to a situation where the course_modules records are pointing to a course_section, but the course_section.sequence doesn't contain a reference to the course_module.

      There is duplication of data, and after talking to Marina, there might be other situations where this sort of thing could happen.

      So this issue is to investigate whether we should do something to integrity check this data, or adapt to it.

            marina Marina Glancy
            poltawski Dan Poltawski
            Dan Poltawski Dan Poltawski
            Damyon Wiese Damyon Wiese
            Damyon Wiese Damyon Wiese
            Votes:
            1 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved:

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