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

@ -61,8 +61,9 @@ class block_site_main_menu extends block_list {
/// slow & hacky editing mode
$ismoving = ismoving($course->id);
$section = get_course_section(0, $course->id);
course_create_sections_if_missing($course, 0);
$modinfo = get_fast_modinfo($course);
$section = $modinfo->get_section_info(0);
$groupbuttons = $course->groupmode;
$groupbuttonslink = (!$course->groupmodeforce);