r90934 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90933‎ | r90934 | r90935 >
Date:04:00, 28 June 2011
Author:bawolff
Status:ok (Comments)
Tags:
Comment:
(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).
Modified paths:
  • /trunk/phase3/includes/specials/SpecialUserlogin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialUserlogin.php
@@ -224,6 +224,10 @@
225225 if( $wgUser->isAnon() ) {
226226 $wgUser = $u;
227227 $wgUser->setCookies();
 228+ // This should set it for OutputPage and the Skin
 229+ // which is needed or the personal links will be
 230+ // wrong.
 231+ RequestContext::getMain()->setUser( $u );
228232 wfRunHooks( 'AddNewAccount', array( $wgUser, false ) );
229233 $wgUser->addNewUserLogEntry();
230234 if( $this->hasSessionCookie() ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r98237(bug 31191) Followup to r90934: do this in the successful login code path too...catrope19:21, 27 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r85250Continue with r85240; Move getSkin from User to RequestContext, do it without...dantman12:46, 3 April 2011

Comments

#Comment by Bawolff (talk | contribs)   04:08, 28 June 2011

This is partially a follow up to r85250 (Where resource Context was introduced into Skin.php) Its also a follow up to whenever ResourceContext was introduced to OutputPage.

I'm also making the assumption here that the main request context will always be the one used by the global instances of OutputPage, and the Skin that are associated with the "main" request (aka $wgOut). Is that a safe assumption?

Status & tagging log