From 2cfb5b8efe63ffd95d51a7dc4960b597a2dfc4c6 Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Thu, 21 Mar 2024 16:45:34 +0100 Subject: [PATCH] MDL-81326 mod_book: Deprecate book_get_nav_classes While reviewing MDL-72376, I realised book_get_nav_classes is not used anymore in Moodle LMS since Moodle 4.0 so it should be deprecated Probably it should have been deprecated together with book_get_nav_types. --- mod/book/deprecatedlib.php | 13 +++++++++++++ mod/book/lib.php | 8 -------- mod/book/upgrade.txt | 4 +++- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/mod/book/deprecatedlib.php b/mod/book/deprecatedlib.php index 8c2c23ec10e..6783da2d6bd 100644 --- a/mod/book/deprecatedlib.php +++ b/mod/book/deprecatedlib.php @@ -36,3 +36,16 @@ function book_scale_used() { function book_get_nav_types() { throw new coding_exception(__FUNCTION__ . '() has been removed.'); } + +/** + * Returns list of available navigation link CSS classes. + * + * @deprecated since Moodle 4.4. + * @todo MDL-81328 Final deprecation in Moodle 4.8. + * @return array + */ +function book_get_nav_classes() { + debugging(__FUNCTION__ . '() is deprecated. There is no replacement.'); + + return ['navtoc', 'navimages', 'navtext']; +} diff --git a/mod/book/lib.php b/mod/book/lib.php index 4ad547c73a3..32254d72ed5 100644 --- a/mod/book/lib.php +++ b/mod/book/lib.php @@ -44,14 +44,6 @@ function book_get_numbering_types() { } /** - * Returns list of available navigation link CSS classes. - * @return array - */ -function book_get_nav_classes() { - return array ('navtoc', 'navimages', 'navtext'); -} - -/** * Add book instance. * * @param stdClass $data diff --git a/mod/book/upgrade.txt b/mod/book/upgrade.txt index dce1213b606..d3c9de423c6 100644 --- a/mod/book/upgrade.txt +++ b/mod/book/upgrade.txt @@ -1,8 +1,10 @@ -This files describes API changes in the book code. +This file describes API changes in the book code. === 4.4 === * The previously deprecated `book_get_nav_types` method has been removed, along with the `BOOK_LINK_*` constants +* book_get_nav_classes() has been deprecated and won't have replacement because it's not required anymore. It should have been + deprecated together with book_get_nav_types. === 4.0 === -- 2.11.4.GIT