From 331656263679d8bfe55ac00deebb94bf91da771b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luca=20B=C3=B6sch?= Date: Wed, 14 Apr 2021 01:39:21 +0200 Subject: [PATCH] MDL-71324 course: Render hasinfo class only if necessary. --- course/classes/output/section_format/cmitem.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/course/classes/output/section_format/cmitem.php b/course/classes/output/section_format/cmitem.php index 894c2c27b7b..1825f27b2aa 100644 --- a/course/classes/output/section_format/cmitem.php +++ b/course/classes/output/section_format/cmitem.php @@ -89,7 +89,8 @@ class cmitem implements renderable, templatable { $data = new stdClass(); $data->cms = []; - $showactivityconditions = $course->showcompletionconditions == COMPLETION_SHOW_CONDITIONS; + $completionenabled = $course->enablecompletion == COMPLETION_ENABLED; + $showactivityconditions = $completionenabled && $course->showcompletionconditions == COMPLETION_SHOW_CONDITIONS; $showactivitydates = !empty($course->showactivitydates); // This will apply styles to the course homepage when the activity information output component is displayed.