mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-58486 userprefs: clarifying comment
This commit is contained in:
parent
48411a8843
commit
4ba4ecfa96
1 changed files with 2 additions and 0 deletions
|
@ -1932,6 +1932,7 @@ function set_user_preference($name, $value, $user = null) {
|
||||||
|
|
||||||
// Update value in cache.
|
// Update value in cache.
|
||||||
$user->preference[$name] = $value;
|
$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) {
|
if ($user !== $USER && $user->id == $USER->id) {
|
||||||
$USER->preference[$name] = $value;
|
$USER->preference[$name] = $value;
|
||||||
}
|
}
|
||||||
|
@ -2004,6 +2005,7 @@ function unset_user_preference($name, $user = null) {
|
||||||
|
|
||||||
// Delete the preference from cache.
|
// Delete the preference from cache.
|
||||||
unset($user->preference[$name]);
|
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) {
|
if ($user !== $USER && $user->id == $USER->id) {
|
||||||
unset($USER->preference[$name]);
|
unset($USER->preference[$name]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue