mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
moodlelib: MDL-17208 user preference caching was causing a notice.
This commit is contained in:
parent
9b426d0380
commit
2e3adc25b2
@ -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)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user