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

Deleted sections reappear when moving sections

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Trivial Trivial
    • None
    • 1.6
    • Course
    • None
    • All
    • Any
    • MOODLE_16_STABLE

      Moodle never really deletes a section from the database. This is probably a good thing. Otherwise a teacher could lose part of the course by accidently setting the number of sections too low.

      One of our teachers, however, was trying to convert a weekly format course with 44 sections into a topics format class with only 6 sections. He made the necessary changes in course settings and everything looked fine. Yet whenever he tried to move a section, all 44 sections would show up again.

      I searched the code and found that the move_section() function in course/lib.php does a Check for duplicates (line 1679). This resets numsections to the total number of sections in the database (line 1690). When I commented out the entire duplicate check (lines 1681-1693), the issue went away.

      How necessary is the duplicate section number check? The comment says it is for a very rare case. Could the code just be removed or should it be rewritten?

            poltawski Dan Poltawski
            imported Imported (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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