-
Bug
-
Resolution: Fixed
-
Critical
-
2.3
-
MOODLE_23_STABLE
-
MOODLE_23_STABLE
-
MDL-32215-master -
It is possible for the course_sections table to contain multiple entries with the same 'course' (course id) and section (section number).
This does not work correctly in the code because (a) what does that mean, and (b) get_all_sections uses section number as key for the array anyway.
There is already an index on these two fields but it is not set to unique. I propose:
1) In database update, find all duplicates. For each duplicate, delete all rows except one (leaving the 'original' row with lowest id).
2) In same update, change index so that it is set to unique.
3) Adding a unique index may cause problem in code which moves sections (e.g. if it swaps two sections A=2 and B=3 by first setting A to 3 then B to 2, this will conflict - to solve the problem, need to e.g. set A to 10000003 then B to 2 then A to 3). Find and fix this code.
NOTE: In our VLE 2 system we do not have any such duplicates. In our 1.9 system we do, but only 30 rows. So this is probably a rare problem, however the change will make any future code modifications in this area (such as MDL-24419) safer.
- caused a regression
-
MDL-33915 Upgrade attempts to use sectioncache before its created
-
- Closed
-
- duplicates
-
MDL-26706 Course sections: multiple records with the same section number
-
- Closed
-
- has a non-specific relationship to
-
MDL-24419 Allow Conditional Settings for Topic/Week
-
- Closed
-
- is duplicated by
-
MDL-32331 Resources are not visible in some courses
-
- Closed
-