-
Bug
-
Resolution: Won't Fix
-
Minor
-
None
-
4.5
-
MOODLE_405_STABLE
-
MDL-83056-main -
-
-
5
-
HQ 2025 Planning I1 Moppies
This issue is part of the course hierarchy project.
From MDL-81767 onwards, the teacher must use the new "+" dropdown button to create a subsection. However, this new dropdown feature does not respect the max sections setting and allows the addition of new subsections even when the maximum number of sections has been reached. Additionally, it appears that the code from MDL-81798 is not sufficient to prevent the creation of subsections at the backend level.
Steps to reproduce:
- Set "moodlecourse | maxsections" sections to 10.
- Create a course in topics format and add 9 sections (the general section also counts)
- Create one subsection inside an existing section
- Expected: the button to add a section at the end of the course should be replaced by a message indicating the limit has been reached. Also, the "+" dopdowns should not display the add subsection option (or any other creative alternative).
- What happens: nothing
- Create another subsection
- Expected: the limit has been reached so the backend should throw an exception
- What happens: the subsection is created normally.
Technical shaping
I don't think replacing the dropdown with a normal activity chooser when max sections are reached is worth the effort. Most of the rendering is done on the backend, also, it is not common to reach the section limit.
One possible solution may be something similar to what bulk editing does:
- Adding a body class "maxsection" o "toomanysection" to the body when the max sections is reached.
- Add a sccs class "maxsections-hide" to mark elements that must disappear when max section is reached and another "maxsections-show" for element tha must appear.
- Refactor the code to use those css helpers.
- Discovered while testing
-
MDL-82574 Remove subsection from the activity chooser
-
- Closed
-
- has a non-specific relationship to
-
MDL-81767 Add a mod_subsection button to the add activity button.
-
- Closed
-
-
MDL-81798 Prevent the course to try creating mod_subsection instances once the section limit is reached
-
- Closed
-
- will be (partly) resolved by
-
MDL-84038 Subsections are not removed from the 'course_sections' table when deleted causing maxsections bounds failure
-
- Open
-
-
MDL-84291 Deprecate max sections setting
-
- Open
-