From c6c480f786796182c6b5881491c4210e554be117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luca=20B=C3=B6sch?= Date: Fri, 17 Nov 2017 23:20:10 +0100 Subject: [PATCH] MDL-56253 grade: have coursemodule name pass filters. --- grade/grading/lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grade/grading/lib.php b/grade/grading/lib.php index d7c82946a18..d2f57e9f63b 100644 --- a/grade/grading/lib.php +++ b/grade/grading/lib.php @@ -185,8 +185,8 @@ class grading_manager { } else if ($this->get_context()->contextlevel >= CONTEXT_COURSE) { list($context, $course, $cm) = get_context_info_array($this->get_context()->id); - if (strval($cm->name) !== '') { - $title = $cm->name; + if ($cm && strval($cm->name) !== '') { + $title = format_string($cm->name, true, array('context' => $context)); } else { debugging('Gradable areas are currently supported at the course module level only', DEBUG_DEVELOPER); $title = $this->get_component();