$wgArticle->exists() on Special pages

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

$wgArticle->exists() on Special pages

a@kid

I have some functions that i wrote that use $wgArticle->exists() to  
determine whether a page exists. These functions are called by my  
skin and are used to build the interface.

Since upgrading from 1.5 to 1.6.3 these functions return fatal errors  
(Call to a member function exists() on a non-object) whenever they  
are called from a Special Page. I am guessing that this because the  
Special Page is not an article. However this worked fine in 1.5.

I can test for the Special namespace before using $wgArticle->exists
() to avoid getting errors but i'm curious ... Has something changed  
between 1.5 and 1.6 that would change the behaviour of $wgArticle-
 >exists() on Special Pages?

I've looked through the release notes for 1.6 and couldn't see  
anything that applied.

thanks

_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: $wgArticle->exists() on Special pages

Brion Vibber
a@kid wrote:

> I have some functions that i wrote that use $wgArticle->exists() to  
> determine whether a page exists. These functions are called by my  
> skin and are used to build the interface.
>
> Since upgrading from 1.5 to 1.6.3 these functions return fatal errors  
> (Call to a member function exists() on a non-object) whenever they  
> are called from a Special Page. I am guessing that this because the  
> Special Page is not an article. However this worked fine in 1.5.
>
> I can test for the Special namespace before using $wgArticle->exists
> () to avoid getting errors but i'm curious ... Has something changed  
> between 1.5 and 1.6 that would change the behaviour of $wgArticle-
>  >exists() on Special Pages?
Yes, the initialization is a bit different. It may or may not be a bug, but
$wgArticle doesn't really make sense for special pages.

Use $wgTitle instead.

-- brion vibber (brion @ pobox.com)


_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l

signature.asc (257 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: $wgArticle->exists() on Special pages

a@kid
In reply to this post by a@kid
Thanks Brian. Using $wgTitle is the best solution.

_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l