From: Alexandre Emsenhuber Date: Sun, 13 Dec 2009 20:55:09 +0000 (+0000) Subject: * (bug 21441) meta=userinfo&uiprop=options no longer returns default options for... X-Git-Tag: 1.31.0-rc.0~38546 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=270950f611c51291f4ce56a9dde9ff2cf2c1f3b5;p=lhc%2Fweb%2Fwiklou.git * (bug 21441) meta=userinfo&uiprop=options no longer returns default options for logged-in users under certain circumstances User::$mOptions is no now only set when calling User::loadOptions() and thus remain null on cache hit and thus the api displays default user settings --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 6d9e6b8702..52d64103ec 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -747,6 +747,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 19523) Add inprop=watched to prop=info * (bug 21589) API: Separate summary and initial page text for uploads * (bug 21817) list=usercontribs returns empty result for empty ucuser +* (bug 21441) meta=userinfo&uiprop=options no longer returns default options + for logged-in users under certain circumstances === Languages updated in 1.16 === diff --git a/includes/User.php b/includes/User.php index f3e239b269..e341e5291d 100644 --- a/includes/User.php +++ b/includes/User.php @@ -1957,6 +1957,16 @@ class User { } } + /** + * Get all user's options + * + * @return array + */ + public function getOptions() { + $this->loadOptions(); + return $this->mOptions; + } + /** * Get the user's current setting for a given option, as a boolean value. * diff --git a/includes/api/ApiQueryUserInfo.php b/includes/api/ApiQueryUserInfo.php index 143ec39a99..320803b1ca 100644 --- a/includes/api/ApiQueryUserInfo.php +++ b/includes/api/ApiQueryUserInfo.php @@ -88,7 +88,7 @@ class ApiQueryUserInfo extends ApiQueryBase { $result->setIndexedTagName($vals['changeablegroups']['remove-self'], 'g'); } if (isset($this->prop['options'])) { - $vals['options'] = (is_null($wgUser->mOptions) ? User::getDefaultOptions() : $wgUser->mOptions); + $vals['options'] = $wgUser->getOptions(); } if (isset($this->prop['preferencestoken']) && is_null($this->getMain()->getRequest()->getVal('callback'))) { $vals['preferencestoken'] = $wgUser->editToken();