mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +02:00
MDL-24419 Fix bug with section creation for new courses
This commit is contained in:
parent
ce4dfd2703
commit
52f1406101
2 changed files with 7 additions and 0 deletions
|
@ -539,6 +539,11 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||||
} else {
|
} else {
|
||||||
// This will create a course section if it doesn't exist..
|
// This will create a course section if it doesn't exist..
|
||||||
$thissection = get_course_section($section, $course->id);
|
$thissection = get_course_section($section, $course->id);
|
||||||
|
|
||||||
|
// The returned section is only a bare database object rather than
|
||||||
|
// a section_info object - we will need at least the uservisible
|
||||||
|
// field in it.
|
||||||
|
$thissection->uservisible = true;
|
||||||
}
|
}
|
||||||
// Show the section if the user is permitted to access it, OR if it's not available
|
// Show the section if the user is permitted to access it, OR if it's not available
|
||||||
// but showavailability is turned on
|
// but showavailability is turned on
|
||||||
|
|
|
@ -2751,8 +2751,10 @@ function get_course_section($section, $courseid) {
|
||||||
$cw->summaryformat = FORMAT_HTML;
|
$cw->summaryformat = FORMAT_HTML;
|
||||||
$cw->sequence = "";
|
$cw->sequence = "";
|
||||||
$id = $DB->insert_record("course_sections", $cw);
|
$id = $DB->insert_record("course_sections", $cw);
|
||||||
|
rebuild_course_cache($courseid, true);
|
||||||
return $DB->get_record("course_sections", array("id"=>$id));
|
return $DB->get_record("course_sections", array("id"=>$id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Given a full mod object with section and course already defined, adds this module to that section.
|
* Given a full mod object with section and course already defined, adds this module to that section.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue