[Mediawiki-l] Getting non-object error in Title::newFromText

John Straffin john.straffin at duke.edu
Wed Feb 23 13:21:47 UTC 2005

Brion Vibber wrote:
> John Straffin wrote:
>> Error:
>> Fatal error: Call to a member function on a non-object in
>> /var/www/html/internal/wiki/includes/Title.php on line 1196
>> Begin Code:
>> (Note: $_SERVER["REMOTE_USER"] = jcstraff)
>> (in modified User.php)
>>     $name = $_SERVER["REMOTE_USER"];
>>     $u = User::newFromName( $name );
> [snip]
>>         $t = $wgContLang->ucfirst( $r );   # # # # # # <== LINE 1196
> [snip]
> Is this mysterious contextless modified User.php code being run before
> $wgLang and $wgContLang are initialized?

Sorry (re: "contextless"). This is still me trying to get the user 
identified by $_SERVER["REMOTE_USER"] auto-logged in. The code previously 
posted by David Cameron on 18 Feb works to do this providing that I do the 

(1) Comment out the five Title.php lines that relate to line 1196
(2) Comment out the Cookie testing code in User::loadFromSession
(3) Comment out the UserUpdate() and $wgDeferredUpdateList line from
     David's code (apparently legacy code from 1.3.x, I'm using 1.4.x)

With those three changes, MediaWiki successfully logs me in automatically. 
Ideally, however, I'd like to not have to comment out the Title.php lines 
and the cookie code, but I'm kinda stuck. It appears that (as you suppose 
above) the User.php code is being run before $wgLang and $wgContLang are 
initialized. Is there any way I can juggle this around so as to have these 
objects initialized (perhaps initializing them in my code block?)

**OR**, conversely, can anyone give a quick "howto" on AuthPlugin.php? Now 
that I've peeked at it, it appears to be what I should really be using...

- John
John Straffin -+- Duke Univ OIT Tech Support -+- john.straffin at duke.edu
Need Help? Dial 684-2200 or "Ask for help" @ http://www.duke.edu/online
"Let's do a dance for the computer-genius-man!" -- StrongBad Email #118

() the ascii ribbon campaign against html mail -- http://arc.pasp.de ()
/\                                                                   /\

More information about the MediaWiki-l mailing list