From 49d005eefa0879bddd62dc050230a45ad0b21b77 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Thu, 21 Jul 2005 18:48:26 +0000 Subject: [PATCH] Try to maintain user preferences synchronised between DB and $USER. Merged from MOODLE_15_STABLE --- lib/moodlelib.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 7a838865a43..b912b3d69b9 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -763,6 +763,12 @@ function unset_user_preference($name, $userid=NULL) { } } + //Delete the preference from $USER + if (isset($USER->preference[$name])) { + unset($USER->preference[$name]); + } + + //Then from DB return delete_records('user_preferences', 'userid', $userid, 'name', $name); }