From dbebd5966ff064a4cf1fb606626f0826e32bbe43 Mon Sep 17 00:00:00 2001 From: Mohamed Alsharaf Date: Thu, 4 Jul 2013 20:16:10 +1200 Subject: [PATCH] MDL-38747 blocks: course format options 'numsections' is required to display the block --- blocks/section_links/block_section_links.php | 5 +++++ 1 file changed, 5 insertions(+) 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);