MDL-79124 user: final removal of deprecated user preference methods.
This commit is contained in:
@@ -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.');
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user