diff --git a/Changes.md b/Changes.md index c006621d..a4d2e752 100644 --- a/Changes.md +++ b/Changes.md @@ -4,6 +4,7 @@ History Version 403.1.2 - TBR ---------------------------- 1. Fix 'Orphaned Section still appear in Index Drawer'. +2. Fix 'Restrict access can cause no content in other sections to be shown.' - #202. Version 403.1.1 - 22/01/2024 ---------------------------- diff --git a/classes/output/courseformat/content.php b/classes/output/courseformat/content.php index c57dcb87..aba1b9ba 100644 --- a/classes/output/courseformat/content.php +++ b/classes/output/courseformat/content.php @@ -88,10 +88,13 @@ public function export_for_template(\renderer_base $output) { $currentsectionid = 0; if (!empty($sections)) { - // Most formats uses section 0 as a separate section so we remove from the list. - $initialsection = array_shift($sections); - if (!$singlesection) { - $data->initialsection = $initialsection; + // Is first entry section 0? + if ($sections[0]->num === 0) { + // Most formats uses section 0 as a separate section so we remove from the list. + $initialsection = array_shift($sections); + if (!$singlesection) { + $data->initialsection = $initialsection; + } } if (($editing) || ($singlesection)) { // This triggers the display of the standard list of section(s). $data->sections = $sections;