diff --git a/blocks/section_links/block_section_links.php b/blocks/section_links/block_section_links.php index 6e4bd1e1d35..cc7c88c46a4 100644 --- a/blocks/section_links/block_section_links.php +++ b/blocks/section_links/block_section_links.php @@ -84,6 +84,11 @@ class block_section_links extends block_base { $courseformatoptions = $courseformat->get_format_options(); $context = context_course::instance($course->id); + // Course format options 'numsections' is required to display the block. + if (empty($courseformatoptions['numsections'])) { + return $this->content; + } + // Prepare the highlight value. if ($course->format == 'weeks') { $highlight = ceil((time() - $course->startdate) / 604800);