From 6b11cd340c029a3177fbb7177b6660357720b158 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 | 3 +++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/course/format/classes/base.php b/course/format/classes/base.php index a5cb15a656a..e947ebf9cac 100644 --- a/course/format/classes/base.php +++ b/course/format/classes/base.php @@ -841,16 +841,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 bd9249216ec..aec45425d04 100644 --- a/course/format/upgrade.txt +++ b/course/format/upgrade.txt @@ -2,6 +2,9 @@ This files describes API changes for course formats Overview of this plugin type at https://moodledev.io/docs/apis/plugintypes/format +=== 4.2.7 === +* The core_courseformat\base::get_format_string last parameter has been removed because it was erroneous. + === 4.2 === * New core_courseformat\base::get_context() to get the course context directly from the format instance. * New core_courseformat\base::delete_module() method. Now format plugins can extend the activity deletion logic