MDL-66431 core: Fix section 0 not being dispayed on course page.

This is just to make Behat tests to pass. There is a bug
discovered MDL-71382. We will address that tracker after 3.11
release. For now we just replicate stables behavior.
This commit is contained in:
Ilya Tregubov
2021-05-01 16:22:03 +02:00
parent cf1cf222e7
commit bff4be683a
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -161,6 +161,11 @@ class section_format implements renderable, templatable {
$completioninfo = new completion_info($course);
$data->completioninfo = $completioninfo->display_help_icon();
$header = new $this->headerclass($format, $thissection);
if (empty($this->hidetitle) && !is_null($thissection->name)
&& !($thissection->name === '')) {
$data->header = $header->export_for_template($output);
}
return $data;
}
@@ -76,7 +76,7 @@ class header implements renderable, templatable {
if ($section->section > $format->get_last_section_number()) {
// Stealth sections (orphaned) has special title.
$data->title = get_string('orphanedactivitiesinsectionno', '', $section->section);
} else if ($section->section == $format->get_section_number()) {
} else if ($section->section && ($section->section == $format->get_section_number())) {
// Regular section title.
$data->title = $output->section_title_without_link($section, $course);
$data->issinglesection = true;