From d70ed83644c864f6bdd03a374285d1fc20b9588d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luca=20B=C3=B6sch?= Date: Fri, 24 Feb 2023 10:44:15 +0100 Subject: [PATCH] MDL-77014 course: Single activity format course title multilang. --- .../tests/behat/activity_navigation.feature | 10 ++++++++++ theme/boost/classes/output/core_renderer.php | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/course/format/singleactivity/tests/behat/activity_navigation.feature b/course/format/singleactivity/tests/behat/activity_navigation.feature index 6849f7e0a9c..e8d3d7ee94e 100644 --- a/course/format/singleactivity/tests/behat/activity_navigation.feature +++ b/course/format/singleactivity/tests/behat/activity_navigation.feature @@ -76,3 +76,13 @@ Feature: Activity navigation in a single activity course Given I log in as "student2" When I am on "Course 1" course homepage Then I should see "You cannot enrol yourself in this course" + + Scenario: The single activity course format supports multilang course names + Given the "multilang" filter is "on" + And the "multilang" filter applies to "content and headings" + When I am on the "Course 1" "course editing" page logged in as "teacher1" + And I expand all fieldsets + And I set the field "Course full name" in the "General" "fieldset" to "KursCourse 1" + And I click on "Save and display" "button" + Then I should see "Course 1" in the ".page-header-headings" "css_element" + And I should not see "KursCourse 1" in the ".page-header-headings" "css_element" diff --git a/theme/boost/classes/output/core_renderer.php b/theme/boost/classes/output/core_renderer.php index f1a4f6a179d..bfe9e072694 100644 --- a/theme/boost/classes/output/core_renderer.php +++ b/theme/boost/classes/output/core_renderer.php @@ -157,7 +157,7 @@ class core_renderer extends \core_renderer { $prefix = null; if ($context->contextlevel == CONTEXT_MODULE) { if ($this->page->course->format === 'singleactivity') { - $heading = $this->page->course->fullname; + $heading = format_string($this->page->course->fullname, true, ['context' => $context]); } else { $heading = $this->page->cm->get_formatted_name(); $imagedata = html_writer::img($this->page->cm->get_icon_url()->out(false), '',