Log backtrace for "User::loadFromSession called before the end of Setup.php"

Fixing the bug will be much easier if we know where it's being called
from.

Bug: T124367
Change-Id: I69cd8bc2bb0677819763c59a221f098d564c92cd
This commit is contained in:
Brad Jorsch 2016-01-25 13:00:00 -05:00 committed by BryanDavis
parent e5e63fafc3
commit c00d0b5d94

View file

@ -327,7 +327,9 @@ class User implements IDBAccessObject {
// If this is called too early, things are likely to break.
if ( $this->mFrom === 'session' && empty( $wgFullyInitialised ) ) {
\MediaWiki\Logger\LoggerFactory::getInstance( 'session' )
->warning( 'User::loadFromSession called before the end of Setup.php' );
->warning( 'User::loadFromSession called before the end of Setup.php', array(
'exception' => new Exception( 'User::loadFromSession called before the end of Setup.php' ),
) );
$this->loadDefaults();
$this->mLoadedItems = $oldLoadedItems;
return;