MDL-79124 user: final removal of deprecated user preference methods.

This commit is contained in:
Paul Holden
2025-03-12 08:07:39 +00:00
parent 2f82f5fe8c
commit 5f4565b271
7 changed files with 24 additions and 98 deletions
+2 -16
View File
@@ -194,24 +194,10 @@ M.util.CollapsibleRegion.prototype.div = null;
M.util.CollapsibleRegion.prototype.icon = null;
/**
* Makes a best effort to connect back to Moodle to update a user preference,
* however, there is no mechanism for finding out if the update succeeded.
*
* Before you can use this function in your JavsScript, you must have called
* user_preference_allow_ajax_update from moodlelib.php to tell Moodle that
* the udpate is allowed, and how to safely clean and submitted values.
*
* @param {String} name the name of the setting to update.
* @param {String} value the value to set it to.
*
* @deprecated since Moodle 4.3.
*/
M.util.set_user_preference = function(name, value) {
Y.log('M.util.set_user_preference is deprecated. Please use the "core_user/repository" module instead.', 'warn');
require(['core_user/repository'], function(UserRepository) {
UserRepository.setUserPreference(name, value);
});
M.util.set_user_preference = function() {
throw new Error('M.util.set_user_preference is deprecated. Please use the "core_user/repository" module instead.');
};
/**