From fe4fd6d8179a67c2efed8c1cd3003dc7686d5a6e Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Mon, 21 Feb 2022 15:08:50 +0800 Subject: [PATCH] MDL-73756 lib: deprecate modinfo parameter from get_data --- lib/completionlib.php | 12 +++++++----- lib/upgrade.txt | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/completionlib.php b/lib/completionlib.php index 2b910d33ed2..cd6edf242fc 100644 --- a/lib/completionlib.php +++ b/lib/completionlib.php @@ -1014,16 +1014,18 @@ class completion_info { * fill the cache, retrieves information from the entire course not just for * this one activity * @param int $userid User ID or 0 (default) for current user - * @param array $modinfo Supply the value here - this is used for unit - * testing and so that it can be called recursively from within - * get_fast_modinfo. (Needs only list of all CMs with IDs.) - * Otherwise the method calls get_fast_modinfo itself. + * @param null $unused This parameter has been deprecated since 4.0 and should not be used anymore. * @return object Completion data. Record from course_modules_completion plus other completion statuses such as * - Completion status for 'must-receive-grade' completion rule. * - Custom completion statuses defined by the activity module plugin. */ - public function get_data($cm, $wholecourse = false, $userid = 0, $modinfo = null) { + public function get_data($cm, $wholecourse = false, $userid = 0, $unused = null) { global $USER, $DB; + + if ($unused !== null) { + debugging('Deprecated argument passed to ' . __FUNCTION__, DEBUG_DEVELOPER); + } + $completioncache = cache::make('core', 'completion'); // Get user ID diff --git a/lib/upgrade.txt b/lib/upgrade.txt index d8d0e597ac2..b8a80504087 100644 --- a/lib/upgrade.txt +++ b/lib/upgrade.txt @@ -233,6 +233,7 @@ value to get the list of blocks that won't be displayed for a theme. $strength passed to it. * A new method get_page() has been added to the settings_navigation class. This method can be used to obtain the moodle_page object associated to the settings navigation. +* The parameter $modinfo of the get_data method in completion_info class has been deprecated and is not used anymore. === 3.11.4 === * A new option dontforcesvgdownload has been added to the $options parameter of the send_file() function.