-
Bug
-
Resolution: Fixed
-
Minor
-
2.6
-
MOODLE_26_STABLE
-
MOODLE_24_STABLE, MOODLE_25_STABLE
-
MDL-41045-master -
The course_add_cm_to_section has a comment about not using modinfo because it might not be valid. (It clears modinfo, but does not use it directly.) However, it calls course_create_sections_if_missing which does use modinfo.
This causes performance problems if you try to add a cm to a section repeatedly, which I am doing at present; each time it will create modinfo, then clear it. Additionally, presumably there was some reason for not using modinfo in the first place.
I propose that we change course_create_sections_if_missing so that it optionally doesn't use modinfo.