navigation MDL-21564 Fixed regression whereby the last course section was not being shown on the navigation

This commit is contained in:
Sam Hemelryk
2010-02-10 01:28:17 +00:00
parent 0e3eee62fe
commit 279e2669eb
+2 -5
View File
@@ -1754,11 +1754,8 @@ class global_navigation extends navigation_node {
$selectedstructure = optional_param($activeparam,false,PARAM_INT);
// This is required to make sure that if people have reduced the number
// of sections after adding activities to sections that no longer exist
// we dont show them
// MDL-20242
$sections = array_slice($sections, 0, $course->numsections, true);
// MDL-20242 + MDL-21564
$sections = array_slice($sections, 0, $course->numsections+1, true);
foreach ($sections as $section) {
if ((!$viewhiddensections && !$section->visible) || (!$this->showemptybranches && !array_key_exists($section->section, $modinfo->sections))) {