diff --git a/src/applications/people/storage/PhabricatorUser.php b/src/applications/people/storage/PhabricatorUser.php --- a/src/applications/people/storage/PhabricatorUser.php +++ b/src/applications/people/storage/PhabricatorUser.php @@ -487,7 +487,7 @@ if ($this->getPHID()) { $settings = $this->requireCacheData($settings_key); } else { - $settings = array(); + $settings = $this->loadGlobalSettings(); } // NOTE: To slightly improve performance, we're using all settings here, @@ -555,6 +555,20 @@ return $this->getUserSetting(PhabricatorTimezoneSetting::SETTINGKEY); } + private function loadGlobalSettings() { + $cache_key = 'user.settings.global'; + $cache = PhabricatorCaches::getRequestCache(); + $settings = $cache->getKey($cache_key); + + if ($settings === null) { + $preferences = PhabricatorUserPreferences::loadGlobalPreferences($this); + $settings = $preferences->getPreferences(); + $cache->setKey($cache_key, $settings); + } + + return $settings; + } + /** * Override the user's timezone identifier.