mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Merge branch 'wip-MDL-57769-master' of https://github.com/marinaglancy/moodle
This commit is contained in:
commit
aa2b5b214d
43 changed files with 1365 additions and 388 deletions
|
@ -777,6 +777,9 @@ class enrol_database_plugin extends enrol_plugin {
|
|||
if ($templatecourse) {
|
||||
if ($template = $DB->get_record('course', array('shortname'=>$templatecourse))) {
|
||||
$template = fullclone(course_get_format($template)->get_course());
|
||||
if (!isset($template->numsections)) {
|
||||
$template->numsections = course_get_format($template)->get_last_section_number();
|
||||
}
|
||||
unset($template->id);
|
||||
unset($template->fullname);
|
||||
unset($template->shortname);
|
||||
|
|
|
@ -758,8 +758,7 @@ class enrol_database_testcase extends advanced_testcase {
|
|||
$course8['category'] = $defcat->id;
|
||||
$record = $DB->get_record('course', $course8);
|
||||
$this->assertFalse(empty($record));
|
||||
$courseformatoptions = course_get_format($record)->get_format_options();
|
||||
$this->assertEquals($courseformatoptions['numsections'], 666);
|
||||
$this->assertEquals(666, course_get_format($record)->get_last_section_number());
|
||||
|
||||
// Test invalid category.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue