function loadFromDatabase() {
global $wgCommandLineMode, $wgAnonGroupId, $wgLoggedInGroupId;
$fname = "User::loadFromDatabase";
- if ( $this->mDataLoaded || $wgCommandLineMode ) {
+
+ # Counter-intuitive, breaks various things, use User::setLoaded() if you want to suppress
+ # loading in a command line script, don't assume all command line scripts need it like this
+ #if ( $this->mDataLoaded || $wgCommandLineMode ) {
+ if ( $this->mDataLoaded ) {
return;
}
global $wgDatabase;
global $wgCommandLineMode; # this needs to be saved while getID() and getName() are called
- $CommandLineMode_save = $wgCommandLineMode;
- $wgCommandLineMode = false; # otherwise User:loadfromDatabase() early returns, but we need it herein
-
if ( $wgDatabase->tableExists( 'user_newtalk' ) ) {
$res = $wgDatabase->safeQuery( 'SELECT user_id, user_ip FROM !',
$wgDatabase->tableName( 'user_newtalk' ) );
} else {
echo "ENOTIF: No user_newtalk table found. Nothing to convert to watchlist table entries.\n";
}
- $wgCommandLineMode = $CommandLineMode_save;
}