From 80ddffea978cac1822a15b885cb6c45a7e2acbde Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Wed, 20 Sep 2023 23:20:12 +0100 Subject: [PATCH] MDL-71950 completion: final removal of deprecated help_icon methods. --- completion/upgrade.txt | 5 +++++ lib/completionlib.php | 22 ++-------------------- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/completion/upgrade.txt b/completion/upgrade.txt index b19fd6dac56..dd89cf6cae0 100644 --- a/completion/upgrade.txt +++ b/completion/upgrade.txt @@ -1,6 +1,11 @@ This file describes API changes in /completion/* - completion, information provided here is intended especially for developers. +=== 4.4 === +* The following previously deprecated methods have been removed and can no longer be used: + - `completion_info::display_help_icon` + - `completion_info::print_help_icon` + === 4.3 === * A trait class, core_completion/form/form_trait has been added to reuse code for adding and validation completion settings to any form. diff --git a/lib/completionlib.php b/lib/completionlib.php index 59fdb3a9dc9..3cda36ee2bb 100644 --- a/lib/completionlib.php +++ b/lib/completionlib.php @@ -321,35 +321,17 @@ class completion_info { } /** - * Displays the 'Your progress' help icon, if completion tracking is enabled. - * Just prints the result of display_help_icon(). - * * @deprecated since Moodle 2.0 - Use display_help_icon instead. */ public function print_help_icon() { - debugging('The function print_help_icon() is deprecated, please do not use it anymore.', - DEBUG_DEVELOPER); - print $this->display_help_icon(); + throw new coding_exception(__FUNCTION__ . '() has been removed.'); } /** - * Returns the 'Your progress' help icon, if completion tracking is enabled. - * - * @return string HTML code for help icon, or blank if not needed * @deprecated since Moodle 4.0 - The 'Your progress' info isn't displayed any more. */ public function display_help_icon() { - global $PAGE, $OUTPUT, $USER; - debugging('The function display_help_icon() is deprecated, please do not use it anymore.', - DEBUG_DEVELOPER); - $result = ''; - if ($this->is_enabled() && !$PAGE->user_is_editing() && $this->is_tracked_user($USER->id) && isloggedin() && - !isguestuser()) { - $result .= html_writer::tag('div', get_string('yourprogress','completion') . - $OUTPUT->help_icon('completionicons', 'completion'), array('id' => 'completionprogressid', - 'class' => 'completionprogress')); - } - return $result; + throw new coding_exception(__FUNCTION__ . '() has been removed.'); } /**