Page MenuHomePhabricator

Image links from #ifexist:Media:... are not being registered properly on tawiktionary
Open, Needs TriagePublic


From this list post:

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;
        $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

Event Timeline

Anyways, a suggested fix might be, in the !$file case, to add $parser->mOutput->addImage( $title->getDBKey() )

Hi , @Bawolff I have installed the extension.

What to do next ?

Hi , @Bawolff I have installed the extension.

What to do next ?

Actually I want to know how to produce this error and I don't know how to create a page.

How to produce is covered in the description ("If you do something like {{#ifexist:Media:Foo.ogg}}"); for editing see