From 19af72f6cacb0623b62c9e947d8e1d2b6f53fbe2 Mon Sep 17 00:00:00 2001 From: ferranrecio Date: Tue, 19 Mar 2024 17:27:03 +0100 Subject: [PATCH] MDL-81289 core_courseformat: fix get_format_string params --- course/format/classes/base.php | 7 +++---- course/format/upgrade.txt | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/course/format/classes/base.php b/course/format/classes/base.php index 833c29305a6..6f3b9d970f3 100644 --- a/course/format/classes/base.php +++ b/course/format/classes/base.php @@ -972,16 +972,15 @@ abstract class base { * core_courseformat will be user as the component. * * @param string $key the string key - * @param string|object|array $data extra data that can be used within translation strings - * @param string|null $lang moodle translation language, null means use current + * @param string|object|array|int $data extra data that can be used within translation strings * @return string the get_string result */ - public function get_format_string(string $key, $data = null, $lang = null): string { + public function get_format_string(string $key, $data = null): string { $component = 'format_' . $this->get_format(); if (!get_string_manager()->string_exists($key, $component)) { $component = 'core_courseformat'; } - return get_string($key, $component, $data, $lang); + return get_string($key, $component, $data); } /** diff --git a/course/format/upgrade.txt b/course/format/upgrade.txt index b7c63e15108..a5c1b1971ce 100644 --- a/course/format/upgrade.txt +++ b/course/format/upgrade.txt @@ -54,6 +54,7 @@ value when all the sections must be displayed (instead of 0). That way, section plugins can now include the string 'plugin_description' to provide a description of the course format. * A new item, initsections, has been added to the testing_data_generator::create_course() function, to let the generator rename the sections to "Section X". +* The core_courseformat\base::get_format_string last parameter has been removed because it was erroneous. === 4.3 === * New core_courseformat\output\activitybadge class that can be extended by any module to display content near the activity name.