]> git.mjollnir.org Git - moodle.git/commitdiff
moodlelib: MDL-17208 user preference caching was causing a notice.
authortjhunt <tjhunt>
Wed, 12 Nov 2008 01:26:49 +0000 (01:26 +0000)
committertjhunt <tjhunt>
Wed, 12 Nov 2008 01:26:49 +0000 (01:26 +0000)
lib/moodlelib.php

index 9abd124fa027d3e4df28288b223ee76156618676..c6fc0fcee00bcd5acf5dcd1e9fc05ccd6d05e249 100644 (file)
@@ -939,7 +939,7 @@ function check_user_preferences_loaded($time = null) {
     global $USER, $DB;
     static $timenow = null; // Static cache, so we only check up-to-dateness once per request.
 
-    if (!empty($USER->preference)) {
+    if (!empty($USER->preference) && isset($USER->preference['_lastloaded'])) {
         // Already loaded. Are we up to date?
 
         if (is_null($timenow) || (!is_null($time) && $time != $timenow)) {