MDL-58486 user_prefs: always update $USER cache when applicable
authorTim Hunt <T.J.Hunt@open.ac.uk>
Tue, 4 Apr 2017 15:20:26 +0000 (16:20 +0100)
committerTim Hunt <T.J.Hunt@open.ac.uk>
Tue, 4 Apr 2017 15:20:26 +0000 (16:20 +0100)
commit2524990d09ea547c153873d34d558c585879f539
tree462f68b4309eaa4f7d933a90a0d600484a840595
parentbf919ddf021cacb6711bd00fa3b3b97019ad450a
MDL-58486 user_prefs: always update $USER cache when applicable

set_user_preference and unset_user_preference let you pass the user to
set preferences for as an id. Previously, if you passed $USER->id there,
those methods did not update the Cache in $USER, which was surprising,
and not easy to debug.

Now, we always update the preference cache in $USER if the preference is
being changed for the current user.
lib/moodlelib.php
lib/tests/moodlelib_test.php