-
Bug
-
Resolution: Cannot Reproduce
-
Trivial
-
None
-
1.6
-
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?
- has been marked as being related by
-
MDL-10405 Delete sections
-
- Closed
-