mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 09:26:35 +02:00
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:
parent
9796014660
commit
4ede27b253
9 changed files with 76 additions and 45 deletions
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue