Last modified: 2012-04-12 13:55:26 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T30245, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 28245 - Title::getUserPermissionsErrors() does wierd things to StubObjects
Title::getUserPermissionsErrors() does wierd things to StubObjects
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.16.x
All All
: Normal minor (vote)
: ---
Assigned To: Happy-melon
: easy
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-26 01:49 UTC by Happy-melon
Modified: 2012-04-12 13:55 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Happy-melon 2011-03-26 01:49:09 UTC
Should be very trivial to fix, but I a) am off to bed, and b) have a corrupted working copy at the moment, so I'll post this here:

public function getUserPermissionsErrors( $action, $user, $doExpensiveQueries = true, $ignoreErrors = array() ) {
 	if( !StubObject::isRealObject( $user ) ) {
 	//Since StubObject is always used on globals, we can unstub $wgUser here and set $user = $wgUser
	global $wgUser;
 	$wgUser->_unstub( '', 5 );
 	$user = $wgUser;
 	}
...

This is wrong because it is testing for stub-ness on $user, but then unconditionally unstubbing $wgUser, assuming that they must be the same.  Why not just call $user->_unstub() ??  Needs investigating and patching.
Comment 1 Mark A. Hershberger 2011-03-26 18:55:45 UTC
Assigning this back to you so that you can fix it when you wake up.
Comment 2 Alexandre Emsenhuber [IAlex] 2011-03-27 16:51:12 UTC
Actually you can just remove the whole check since we don't use a StubObject on $wgUser since r70970.
Comment 3 Mark A. Hershberger 2011-03-29 23:02:16 UTC
any fix for this yet (just checking since you said it was easy and ialex's comment makes it look even more so ;) )
Comment 4 Happy-melon 2011-03-30 11:25:08 UTC
Hehe, this was actually fixed in trunk in r74934... :D

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links