-
Bug
-
Resolution: Cannot Reproduce
-
Minor
-
None
-
2.3.6
-
None
-
MOODLE_23_STABLE
The function add_mod_to_section in the course/lib.php library does not correctly locate the course section where the course module is to be added.
The code uses the following query to find the section:
{$DB->get_record("course_sections", array("course"=>$mod->course, "section"=>$mod->section))}
It should be changed to:
{$DB->get_record("course_sections", array("course"=>$mod->course, "id"=>$mod->section))}
The $mod->section field should refer to the course_sections.id and not to the course_sections.section field