mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
navigation MDL-20242 Fixed bug whereby sections that no longer exist were shown
This commit is contained in:
parent
0a8e8b6fd8
commit
5afb01e899
@ -1318,6 +1318,13 @@ class global_navigation extends navigation_node {
|
||||
$viewhiddensections = $this->cache->canviewhiddensections;
|
||||
|
||||
$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);
|
||||
|
||||
foreach ($sections as $section) {
|
||||
if ((!$viewhiddensections && !$section->visible) || (!$this->showemptybranches && !array_key_exists($section->section, $modinfo->sections))) {
|
||||
continue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user