MDL-36017 Fields numsections, hiddensections and coursedisplay are now format-specific options
- Fields added to format_legacy as default course format options;
- Upgrade script copies fields values from table course to course_format_options;
- Fields removed from table course;
- Fields removed from edit course form;
- Since front-page course has a 'numsections' setting, format_site defines it as it's option;
- Removed accessing those fields in core code unless we know that format supports them and in this
case instead of $course = $DB->get_record('course'); we use:
$course = course_get_format($courseorid)->get_course(); This way all format-specific options
are added to the $course object
This commit is contained in:
@@ -98,6 +98,7 @@
|
||||
echo $OUTPUT->header();
|
||||
|
||||
/// Print Section or custom info
|
||||
$site = course_get_format($SITE)->get_course();
|
||||
$modinfo = get_fast_modinfo($SITE);
|
||||
$modnames = get_module_types_names();
|
||||
$modnamesplural = get_module_types_names(true);
|
||||
@@ -107,7 +108,7 @@
|
||||
if (!empty($CFG->customfrontpageinclude)) {
|
||||
include($CFG->customfrontpageinclude);
|
||||
|
||||
} else {
|
||||
} else if ($site->numsections > 0) {
|
||||
if ($editing) {
|
||||
// make sure section with number 1 exists
|
||||
course_create_sections_if_missing($SITE, 1);
|
||||
|
||||
Reference in New Issue
Block a user