mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +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
|
@ -434,11 +434,8 @@ function process_group_tag($tagcontents) {
|
|||
$course = $DB->get_record('course', array('id' => $courseid));
|
||||
blocks_add_default_course_blocks($course);
|
||||
|
||||
$section = new stdClass();
|
||||
$section->course = $course->id; // Create a default section.
|
||||
$section->section = 0;
|
||||
$section->summaryformat = FORMAT_HTML;
|
||||
$section->id = $DB->insert_record("course_sections", $section);
|
||||
// Create default 0-section
|
||||
course_create_sections_if_missing($course, 0);
|
||||
|
||||
add_to_log(SITEID, "course", "new", "view.php?id=$course->id", "$course->fullname (ID $course->id)");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue