From 9574aee37cccfc91bf018d6a075d11a3b594295c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luca=20B=C3=B6sch?= Date: Wed, 8 Mar 2017 00:57:46 +0100 Subject: [PATCH] MDL-58180 lib: Role name pass format_text. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In function stats_get_report_options, the role names are returned after having been processed through format_text which lets the filters work on them. Signed-off-by: Luca Bösch --- lib/statslib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/statslib.php b/lib/statslib.php index a414faed00f..42cd8237bc2 100644 --- a/lib/statslib.php +++ b/lib/statslib.php @@ -1399,7 +1399,8 @@ function stats_get_report_options($courseid,$mode) { $sql = 'SELECT r.id, r.name FROM {role} r JOIN {stats_daily} s ON s.roleid = r.id WHERE s.courseid = :courseid GROUP BY r.id, r.name'; if ($roles = $DB->get_records_sql($sql, array('courseid' => $courseid))) { foreach ($roles as $role) { - $reportoptions[STATS_REPORT_ACTIVITYBYROLE.$role->id] = get_string('statsreport'.STATS_REPORT_ACTIVITYBYROLE). ' '.$role->name; + $reportoptions[STATS_REPORT_ACTIVITYBYROLE.$role->id] = get_string('statsreport'.STATS_REPORT_ACTIVITYBYROLE). + ' ' . format_string($role->name, true, ['context' => $context]); } } }