diff --git a/course/format/classes/output/local/state/cm.php b/course/format/classes/output/local/state/cm.php
index aa4c3dd9e1b..0c865b3ef0b 100644
--- a/course/format/classes/output/local/state/cm.php
+++ b/course/format/classes/output/local/state/cm.php
@@ -73,7 +73,7 @@ class cm implements renderable {
$data = (object)[
'id' => $cm->id,
- 'name' => $cm->name,
+ 'name' => external_format_string($cm->name, $cm->context, true),
'visible' => !empty($cm->visible),
'sectionid' => $section->id,
'sectionnumber' => $section->section,
diff --git a/course/format/tests/behat/course_courseindex.feature b/course/format/tests/behat/course_courseindex.feature
index 95c22607bb1..9c584f3daa2 100644
--- a/course/format/tests/behat/course_courseindex.feature
+++ b/course/format/tests/behat/course_courseindex.feature
@@ -16,10 +16,10 @@ Feature: Course index depending on role
| enablecompletion | 1 |
| numsections | 4 |
And the following "activities" exist:
- | activity | name | intro | course | idnumber | section |
- | assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
- | book | Activity sample 2 | Test book description | C1 | sample2 | 2 |
- | choice | Activity sample 3 | Test choice description | C1 | sample3 | 3 |
+ | activity | name | intro | course | idnumber | section |
+ | assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
+ | book | Activity sample 2 | Test book description | C1 | sample2 | 2 |
+ | choice | Activity sample 3 | Test choice description | C1 | sample3 | 3 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
@@ -28,9 +28,14 @@ Feature: Course index depending on role
@javascript
Scenario: Course index is present on course and activities.
Given I am on the "C1" "Course" page logged in as "teacher1"
+ Given the "multilang" filter is "on"
+ And the "multilang" filter applies to "content and headings"
+ And I am on the "C1" "Course" page logged in as "teacher1"
When I click on "Side panel" "button"
Then I should see "Open course index drawer"
- And I am on the "Activity sample 1" "assign activity" page
+ And I am on the "Activity sample 1" "assign activity editing" page
+ And I set the field "Assignment name" in the "General" "fieldset" to "ActivityAktivität sample 1"
+ And I press "Save and display"
And I should see "Open course index drawer"
And I click on "Open course index drawer" "button"
And I should see "Activity sample 1" in the "courseindex-content" "region"