From d1397b4552de4c2c08226d125c839ba32c390d38 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Tue, 18 Jun 2024 08:45:37 +0100 Subject: [PATCH] MDL-82223 availability: final removal of deprecated renderer method. --- .upgradenotes/MDL-82223-2024061807452821.yml | 7 +++ availability/renderer.php | 50 +++----------------- 2 files changed, 14 insertions(+), 43 deletions(-) create mode 100644 .upgradenotes/MDL-82223-2024061807452821.yml diff --git a/.upgradenotes/MDL-82223-2024061807452821.yml b/.upgradenotes/MDL-82223-2024061807452821.yml new file mode 100644 index 00000000000..7aa28074335 --- /dev/null +++ b/.upgradenotes/MDL-82223-2024061807452821.yml @@ -0,0 +1,7 @@ +issueNumber: MDL-82223 +notes: + core_availability: + - message: > + The previously deprecated renderer + `render_core_availability_multiple_messages` method has been removed + type: removed diff --git a/availability/renderer.php b/availability/renderer.php index cffc258a0f9..428fadc5274 100644 --- a/availability/renderer.php +++ b/availability/renderer.php @@ -14,13 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -/** - * Renderer for availability display. - * - * @package core_availability - * @copyright 2014 The Open University - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ +use core\output\plugin_renderer_base; +use core_availability\output\availability_info; /** * Renderer for availability display. @@ -30,43 +25,12 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class core_availability_renderer extends plugin_renderer_base { + /** - * Renders HTML for the result of two or more availability restriction - * messages being combined in a list. - * - * The supplied messages should already take account of the 'not' option, - * e.g. an example message could be 'User profile field Department must - * not be set to Maths'. - * - * This function will not be called unless there are at least two messages. - * - * @deprecated since Moodle 4.0 MDL-716916 - please do not use this function any more. - * @param core_availability_multiple_messages $renderable Multiple messages - * @return string Combined HTML + * @deprecated since Moodle 4.0 MDL-71691 - please do not use this function any more. */ - public function render_core_availability_multiple_messages( - core_availability_multiple_messages $renderable) { - - debugging( - 'render_core_availability_multiple_messages is deprecated. Use core_availability\\output\\multiple_messages instead', - DEBUG_DEVELOPER - ); - // Get initial message. - $out = get_string('list_' . ($renderable->root ? 'root_' : '') . - ($renderable->andoperator ? 'and' : 'or') . ($renderable->treehidden ? '_hidden' : ''), - 'availability'); - - // Make the list. - $out .= html_writer::start_tag('ul'); - foreach ($renderable->items as $item) { - if (is_string($item)) { - $str = $item; - } else { - $str = $this->render($item); - } - $out .= html_writer::tag('li', $str); - } - $out .= html_writer::end_tag('ul'); - return $out; + #[\core\attribute\deprecated(availability_info::class, since: '4.0', mdl: 'MDL-71691', final: true)] + public function render_core_availability_multiple_messages(): void { + \core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]); } }