Skip to content

Commit

Permalink
Fix 'Restrict access can cause no content in other sections to be sho…
Browse files Browse the repository at this point in the history
…wn.' - #202.
  • Loading branch information
gjb2048 committed Mar 4, 2024
1 parent b2499c4 commit b6016db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------------------------
Expand Down
11 changes: 7 additions & 4 deletions classes/output/courseformat/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b6016db

Please sign in to comment.