From 3642b6d65d3a58529c57601f52e8d3cae793f71d Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Wed, 29 Dec 2021 12:41:06 +0000 Subject: [PATCH] MDL-73466 forumreport_summary: use formatted course module name. --- mod/forum/report/summary/index.php | 4 ++-- .../summary/tests/behat/course_summary.feature | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/mod/forum/report/summary/index.php b/mod/forum/report/summary/index.php index e0305642a5e..31e794d9471 100644 --- a/mod/forum/report/summary/index.php +++ b/mod/forum/report/summary/index.php @@ -57,7 +57,7 @@ $forumselectoptions = [0 => get_string('forumselectcourseoption', 'forumreport_s foreach ($courseforums as $courseforumid => $courseforum) { if ($courseforum->uservisible) { $forumsvisibletouser[$courseforumid] = $courseforum; - $forumselectoptions[$courseforumid] = $courseforum->name; + $forumselectoptions[$courseforumid] = $courseforum->get_formatted_name(); } } @@ -67,7 +67,7 @@ if ($forumid) { } $filters['forums'] = [$forumid]; - $title = $forumsvisibletouser[$forumid]->name; + $title = $forumsvisibletouser[$forumid]->get_formatted_name(); $forumcm = $forumsvisibletouser[$forumid]; $cms[] = $forumcm; diff --git a/mod/forum/report/summary/tests/behat/course_summary.feature b/mod/forum/report/summary/tests/behat/course_summary.feature index f4374cfdd26..d2782ee2a61 100644 --- a/mod/forum/report/summary/tests/behat/course_summary.feature +++ b/mod/forum/report/summary/tests/behat/course_summary.feature @@ -84,6 +84,18 @@ Feature: Course level forum summary report | First name / Surname | | Student 3 | + Scenario: Course forum summary report correctly formats forum activity names + Given the "multilang" filter is "on" + And the "multilang" filter applies to "content and headings" + And the following "activity" exists: + | activity | forum | + | course | C1 | + | name | F-EngF-Ger | + When I am on the "C1" "Course" page logged in as "teacher1" + And I follow "F-Eng" + And I navigate to "Reports" in current page administration + Then the "Forum selected" select box should contain "F-Eng" + Scenario: Students given the view capability can view their own course report data Given the following "permission overrides" exist: | capability | permission | role | contextlevel | reference |