From 46d12cfa11f9def8d63a31e6fd3ffc3e7024b44f Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Mon, 24 Apr 2023 15:54:20 +0100 Subject: [PATCH] MDL-78012 badges: final removal of deprecated 311 backpack methods. --- badges/ajax.php | 48 ------------------------------------------- badges/upgrade.txt | 8 ++++++++ lib/badgeslib.php | 38 ---------------------------------- lib/deprecatedlib.php | 21 +++++++++++++++++++ 4 files changed, 29 insertions(+), 86 deletions(-) delete mode 100644 badges/ajax.php diff --git a/badges/ajax.php b/badges/ajax.php deleted file mode 100644 index b3528c56bbf..00000000000 --- a/badges/ajax.php +++ /dev/null @@ -1,48 +0,0 @@ -. - -/** - * Sends request to check web site availability. - * - * @package core - * @subpackage badges - * @copyright 2013 onwards Totara Learning Solutions Ltd {@link http://www.totaralms.com/} - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - * @author Yuliya Bozhko - */ - -define('AJAX_SCRIPT', true); - -require_once(__DIR__ . '/../config.php'); -require_once($CFG->libdir . '/badgeslib.php'); - -require_login(); -$PAGE->set_url('/badges/ajax.php'); -$PAGE->set_context(context_system::instance()); - -// Unlock session during potentially long curl request. -\core\session\manager::write_close(); - -$result = badges_check_backpack_accessibility(); - -$outcome = new stdClass(); -$outcome->code = $result; -$outcome->response = get_string('error:backpacknotavailable', 'badges') . $OUTPUT->help_icon('backpackavailability', 'badges'); - -echo $OUTPUT->header(); -echo json_encode($outcome); - -die(); diff --git a/badges/upgrade.txt b/badges/upgrade.txt index 6d3ecb4173c..9baabf4fa90 100644 --- a/badges/upgrade.txt +++ b/badges/upgrade.txt @@ -1,5 +1,13 @@ This files describes API changes in /badges/*, information provided here is intended especially for developers. + +=== 4.3 === +* The following, deprecated since 3.11, have been removed and can no longer be used: + - `badges/ajax.js` + - `badges_check_backpack_accessibility` + - `badges_setup_backpack_js` + - `badges_local_backpack_js` + === 4.0 === * Function print_badge_tabs has been deprecated in favour of manage_badge_action_bar instead diff --git a/lib/badgeslib.php b/lib/badgeslib.php index d1f4d5ff5f0..faaad5953f7 100644 --- a/lib/badgeslib.php +++ b/lib/badgeslib.php @@ -632,20 +632,6 @@ function badges_download($userid) { } } -/** - * Checks if badges can be pushed to external backpack. - * - * @deprecated Since Moodle 3.11. - * @return string Code of backpack accessibility status. - */ -function badges_check_backpack_accessibility() { - // This method was used for OBv1.0. It can be deprecated because OBv1.0 support will be removed. - // When this method will be removed, badges/ajax.php can be removed too (if it keeps containing only a call to it). - debugging('badges_check_backpack_accessibility() can not be used any more, it was only used for OBv1.0', DEBUG_DEVELOPER); - - return 'curl-request-timeout'; -} - /** * Checks if user has external backpack connected. * @@ -687,30 +673,6 @@ function badges_handle_course_deletion($courseid) { } } -/** - * Loads JS files required for backpack support. - * - * @deprecated Since Moodle 3.11. - * @return void - */ -function badges_setup_backpack_js() { - // This method was used for OBv1.0. It can be deprecated because OBv1.0 support will be removed. - debugging('badges_setup_backpack_js() can not be used any more, it was only used for OBv1.0.', DEBUG_DEVELOPER); -} - -/** - * No js files are required for backpack support. - * This only exists to directly support the custom V1 backpack api. - * - * @deprecated Since Moodle 3.11. - * @param boolean $checksite Call check site function. - * @return void - */ -function badges_local_backpack_js($checksite = false) { - // This method was used for OBv1.0. It can be deprecated because OBv1.0 support will be removed. - debugging('badges_local_backpack_js() can not be used any more, it was only used for OBv1.0.', DEBUG_DEVELOPER); -} - /** * Create the site backpack with this data. * diff --git a/lib/deprecatedlib.php b/lib/deprecatedlib.php index ed4802ccbcf..74eb9e68df8 100644 --- a/lib/deprecatedlib.php +++ b/lib/deprecatedlib.php @@ -3230,6 +3230,27 @@ function serialise_tool_proxy() { throw new coding_exception('serialise_tool_proxy has been removed.'); } +/** + * @deprecated Since Moodle 3.11. + */ +function badges_check_backpack_accessibility() { + throw new coding_exception('badges_check_backpack_accessibility() can not be used any more, it was only used for OBv1.0'); +} + +/** + * @deprecated Since Moodle 3.11. + */ +function badges_setup_backpack_js() { + throw new coding_exception('badges_setup_backpack_js() can not be used any more, it was only used for OBv1.0'); +} + +/** + * @deprecated Since Moodle 3.11. + */ +function badges_local_backpack_js() { + throw new coding_exception('badges_local_backpack_js() can not be used any more, it was only used for OBv1.0'); +} + /** * Checks if current user is shown any extra fields when listing users. *