mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-58486 userprefs: clarifying comment
This commit is contained in:
parent
48411a8843
commit
4ba4ecfa96
@ -1932,6 +1932,7 @@ function set_user_preference($name, $value, $user = null) {
|
||||
|
||||
// Update value in cache.
|
||||
$user->preference[$name] = $value;
|
||||
// Update the $USER in case where we've not a direct reference to $USER.
|
||||
if ($user !== $USER && $user->id == $USER->id) {
|
||||
$USER->preference[$name] = $value;
|
||||
}
|
||||
@ -2004,6 +2005,7 @@ function unset_user_preference($name, $user = null) {
|
||||
|
||||
// Delete the preference from cache.
|
||||
unset($user->preference[$name]);
|
||||
// Update the $USER in case where we've not a direct reference to $USER.
|
||||
if ($user !== $USER && $user->id == $USER->id) {
|
||||
unset($USER->preference[$name]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user