From 92eed88a4884ee14fc49a0853c4207023bea3c75 Mon Sep 17 00:00:00 2001 From: Mathias Chouet Date: Mon, 1 Aug 2016 11:11:00 +0200 Subject: [PATCH] Protection against non-existing property "hiddensections" in $COURSE --- footer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/footer.php b/footer.php index 98b4b98..3094155 100644 --- a/footer.php +++ b/footer.php @@ -105,7 +105,7 @@ function draw_navbuttons() { if ($mod->sectionnum > 0 && $sectionnum != $mod->sectionnum) { $thissection = $sections[$mod->sectionnum]; - if ($thissection->visible || !$COURSE->hiddensections || + if ($thissection->visible || (property_exists($COURSE, "hiddensections") && !$COURSE->hiddensections) || has_capability('moodle/course:viewhiddensections', $context) ) { $sectionnum = $mod->sectionnum;