MDL-35339 deprecate get_course_section() replace with course_create_sections_if_missing()

By passing course object instead of course id we ensure proper cache reset"
This commit is contained in:
Marina Glancy 2012-10-08 10:36:01 +08:00
parent 9796014660
commit 4ede27b253
9 changed files with 76 additions and 45 deletions

View file

@ -59,7 +59,8 @@ if (!empty($add)) {
$context = context_course::instance($course->id);
require_capability('moodle/course:manageactivities', $context);
$cw = get_course_section($section, $course->id);
course_create_sections_if_missing($course, $section);
$cw = get_fast_modinfo($course)->get_section_info($section);
if (!course_allowed_module($course, $module->name)) {
print_error('moduledisable');