-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
2.7.9, 2.9
-
None
In Moodle 2.7 and beyond, under certain conditions the side bar block can prevent the course page from displaying, without any option for the user to fix the problem.
To reproduce:
- Create a course in "weekly" format, add a side bar block, and add an activity to the side bar.
- In edit mode, click the "Add section" button on the bottom of the course page twice. (Both the "side bar" section and a new section below it will now be visible.)
- Move the empty section on top of the "side bar" section.
- Click "turn editing off".
From now on, the course page will display an "error writing to database" whenever it is called.
The immediate reason is that block_side_bar tries to correct the numbering of sections, and for that purpose tries to write to the course_sections table when the course page is viewed, which results in a unique index violation.
The actual problem is somewhat deeper I think. (Am developing a patch.)