From 76f8b361050e2e6f6cc2b90d71e16ee2a24827a3 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Wed, 17 Jan 2018 02:18:16 +0100 Subject: [PATCH] MDL-53113 libraries: Also remove core_renderer->notify_xxx() methods Keeping the methods instead of fully deleting them alternative. --- lib/outputrenderers.php | 72 +++++++---------------------------------- lib/upgrade.txt | 2 ++ 2 files changed, 14 insertions(+), 60 deletions(-) diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 4fbdedce39f..82625d8adaa 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -2889,72 +2889,24 @@ EOD; return $this->render_from_template($notification->get_template_name(), $notification->export_for_template($this)); } - /** - * Output a notification at a particular level - in this case, NOTIFY_PROBLEM. - * - * @param string $message the message to print out - * @return string HTML fragment. - * @deprecated since Moodle 3.1 MDL-30811 - please do not use this function any more. - * @todo MDL-53113 This will be removed in Moodle 3.5. - * @see \core\output\notification - */ - public function notify_problem($message) { - debugging(__FUNCTION__ . ' is deprecated.' . - 'Please use \core\notification::add, or \core\output\notification as required', - DEBUG_DEVELOPER); - $n = new \core\output\notification($message, \core\output\notification::NOTIFY_ERROR); - return $this->render($n); + public function notify_problem() { + throw new coding_exception('core_renderer::notify_problem() can not be used any more, '. + 'please use \core\notification::add(), or \core\output\notification as required.'); } - /** - * Output a notification at a particular level - in this case, NOTIFY_SUCCESS. - * - * @param string $message the message to print out - * @return string HTML fragment. - * @deprecated since Moodle 3.1 MDL-30811 - please do not use this function any more. - * @todo MDL-53113 This will be removed in Moodle 3.5. - * @see \core\output\notification - */ - public function notify_success($message) { - debugging(__FUNCTION__ . ' is deprecated.' . - 'Please use \core\notification::add, or \core\output\notification as required', - DEBUG_DEVELOPER); - $n = new \core\output\notification($message, \core\output\notification::NOTIFY_SUCCESS); - return $this->render($n); + public function notify_success() { + throw new coding_exception('core_renderer::notify_success() can not be used any more, '. + 'please use \core\notification::add(), or \core\output\notification as required.'); } - /** - * Output a notification at a particular level - in this case, NOTIFY_MESSAGE. - * - * @param string $message the message to print out - * @return string HTML fragment. - * @deprecated since Moodle 3.1 MDL-30811 - please do not use this function any more. - * @todo MDL-53113 This will be removed in Moodle 3.5. - * @see \core\output\notification - */ - public function notify_message($message) { - debugging(__FUNCTION__ . ' is deprecated.' . - 'Please use \core\notification::add, or \core\output\notification as required', - DEBUG_DEVELOPER); - $n = new \core\output\notification($message, \core\output\notification::NOTIFY_INFO); - return $this->render($n); + public function notify_message() { + throw new coding_exception('core_renderer::notify_message() can not be used any more, '. + 'please use \core\notification::add(), or \core\output\notification as required.'); } - /** - * Output a notification at a particular level - in this case, NOTIFY_REDIRECT. - * - * @param string $message the message to print out - * @return string HTML fragment. - * @deprecated since Moodle 3.1 MDL-30811 - please do not use this function any more. - * @todo MDL-53113 This will be removed in Moodle 3.5. - * @see \core\output\notification - */ - public function notify_redirect($message) { - debugging(__FUNCTION__ . ' is deprecated.' . - 'Please use \core\notification::add, or \core\output\notification as required', - DEBUG_DEVELOPER); - $n = new \core\output\notification($message, \core\output\notification::NOTIFY_INFO); - return $this->render($n); + public function notify_redirect() { + throw new coding_exception('core_renderer::notify_redirect() can not be used any more, '. + 'please use \core\notification::add(), or \core\output\notification as required.'); } /** diff --git a/lib/upgrade.txt b/lib/upgrade.txt index aa1c81d8268..5ffc87fca97 100644 --- a/lib/upgrade.txt +++ b/lib/upgrade.txt @@ -3,6 +3,8 @@ information provided here is intended especially for developers. === 3.5 === +* The core_renderer methods notify_problem(), notify_success(), notify_message() and notify_redirect() that were + deprecated in Moodle 3.1 have been removed. Use \core\notification::add(), or \core\output\notification as required. * The maximum supported precision (the total number of digits) for XMLDB_TYPE_NUMBER ("number") fields raised from 20 to 38 digits. Additionally, the whole number part (precision minus scale) must not be longer than the maximum length of integer fields (20 digits). Note that PHP floats commonly support precision of roughly 15 digits only (MDL-32113).