Last modified: 2010-05-05 19:38:20 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T25412, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 23412 - {{#ifexist}} doesn't work correctly for File namespace
{{#ifexist}} doesn't work correctly for File namespace
Status: RESOLVED INVALID
Product: MediaWiki extensions
Classification: Unclassified
ParserFunctions (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-05 17:39 UTC by Svick
Modified: 2010-05-05 19:38 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Svick 2010-05-05 17:39:59 UTC
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.
Comment 1 Roan Kattouw 2010-05-05 17:49:28 UTC
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}}
Comment 2 Happy-melon 2010-05-05 19:38:20 UTC
(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]].

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links