From this list post: https://lists.wikimedia.org/pipermail/wikitech-l/2020-February/093098.html
If you do something like {{#ifexist:Media:Foo.ogg}}, this should register a link both in the local imagelinks table, and the commons globalimagelinks table. This is used for cache clearing. Currently the link only seems to be added if the file exists.
Expected behaviour: Both DoesNotExist.png and Example.png are registered as image links
Actual Behaviour: Only Example.png is registered.
I think the logic error is due to the early return:
$file = wfFindFile( $title ); if ( !$file ) { return $else; } $parser->mOutput->addImage( $file->getName(), $file->getTimestamp(), $file->getSha1() ); return $file->exists() ? $then : $else;
This will exit before registering the dependency if the file does not exist as wfFindFile will return false.
Getting started steps
- Extension installation: https://www.mediawiki.org/wiki/Extension:ParserFunctions#Installation
- Learn more about Git, Gerrit and how to submit a patch: https://www.mediawiki.org/wiki/Gerrit/Tutorial