From: Brian Wolff Date: Tue, 28 Jun 2011 04:00:40 +0000 (+0000) Subject: (follow-up to some RequestContext revision) When Special:userlogin creates a new... X-Git-Tag: 1.31.0-rc.0~29231 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=3b132646f62b496b73696b8aa8f347147b14c70b;p=lhc%2Fweb%2Fwiklou.git (follow-up to some RequestContext revision) When Special:userlogin creates a new user, not only replace $wgUser, but also do RequestContext::getMain()->setUser( $new_user ); Otherwise this causes a bug in the page immediatly after account creation where the personal url's go to the wrong place, and the js wgUser variables are wrong. I didn't add any release notes, since I'm tagging this for 1.18, and it was broken in 1.18, so its not fixing anything between versions. (hopefully that's correct thing to do). --- diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index e8de862c52..bbd602a2a9 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -224,6 +224,10 @@ class LoginForm extends SpecialPage { if( $wgUser->isAnon() ) { $wgUser = $u; $wgUser->setCookies(); + // This should set it for OutputPage and the Skin + // which is needed or the personal links will be + // wrong. + RequestContext::getMain()->setUser( $u ); wfRunHooks( 'AddNewAccount', array( $wgUser, false ) ); $wgUser->addNewUserLogEntry(); if( $this->hasSessionCookie() ) {