From d941758dfc68809aa931b80b0ca80ccfc1c46cc5 Mon Sep 17 00:00:00 2001 From: Gareth Barnard <1058419+gjb2048@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:41:36 +0100 Subject: [PATCH] V404.1.2 --- Changes.md | 4 ++++ classes/output/courseformat/content/sectionnavigation.php | 4 ++-- version.php | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Changes.md b/Changes.md index f7a9fd6..cfd63f2 100644 --- a/Changes.md +++ b/Changes.md @@ -1,6 +1,10 @@ Version Information =================== +Version 404.1.2 - 24/09/2024 +---------------------------- +1. Fix 'Single page shows is_section_visible()' error. + Version 404.1.1 - 22/09/2024 ---------------------------- 1. Show section zero if the section has meaningful content. diff --git a/classes/output/courseformat/content/sectionnavigation.php b/classes/output/courseformat/content/sectionnavigation.php index 059ff9c..4c0c1bc 100644 --- a/classes/output/courseformat/content/sectionnavigation.php +++ b/classes/output/courseformat/content/sectionnavigation.php @@ -68,7 +68,7 @@ public function export_for_template(\renderer_base $output): \stdClass { $back = $this->sectionno - 1; while ($back > 0 && empty($data->previousurl)) { - if ($canviewhidden || $format->is_section_visible($back)) { + if ($canviewhidden || $format->is_section_visible($sections[$back])) { if (!$sections[$back]->visible) { $data->previoushidden = true; } @@ -82,7 +82,7 @@ public function export_for_template(\renderer_base $output): \stdClass { $forward = $this->sectionno + 1; $numsections = $format->get_last_section_number(); while ($forward <= $numsections && empty($data->nexturl)) { - if ($canviewhidden || $format->is_section_visible($forward)) { + if ($canviewhidden || $format->is_section_visible($sections[$forward])) { if (!$sections[$forward]->visible) { $data->nexthidden = true; } diff --git a/version.php b/version.php index 3795c62..edbf252 100644 --- a/version.php +++ b/version.php @@ -30,9 +30,9 @@ */ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2024032803; +$plugin->version = 2024032804; $plugin->maturity = MATURITY_STABLE; $plugin->requires = 2024042200.00; // 4.4 (Build: 20240422). $plugin->supported = [404, 404]; $plugin->component = 'format_topcoll'; -$plugin->release = '404.1.1'; +$plugin->release = '404.1.2';