{{#ifexist}} doesn't work correctly for File namespace
Closed, InvalidPublic

Description

The parser function {{#ifexist}} works as expected (i.e. checks for an existence of a file, even if it's on commons) if used with Media: prefix, but not with Image: or File:.

I think it is because of the following code in ParserFunctions_body.php:
if( $title->getNamespace() == NS_MEDIA ) {
/* If namespace is specified as NS_MEDIA, then we want to

  • check the physical file, not the "description" page.

*/

It should test here also for the File: and Image: prefixes.


Version: unspecified
Severity: normal

bzimport added a subscriber: wikibugs-l.
bzimport set Reference to bz23412.
Svick created this task.Via LegacyMay 5 2010, 5:39 PM
Catrope added a comment.Via ConduitMay 5 2010, 5:49 PM

I'd say this is a feature rather than a bug: you can test for the existence of the file description page with {{#ifexist:File:Foo.png}} and for the existence of the actual file with {{#ifexist:Media:Foo.png}}

bzimport added a comment.Via ConduitMay 5 2010, 7:38 PM

happy.melon.wiki wrote:

(In reply to comment #1)

I'd say this is a feature rather than a bug

Indeed. It's even (deep breath) *documented* as such: [[mw:Help:Extension:ParserFunctions##ifexist]].

Add Comment