Navigate to https://commons.wikimedia.org/wiki/File:Apthorp_south_jeh.JPG
Now navigate to the same page via a ForeignAPI https://en.wikipedia.org/wiki/File:Apthorp_south_jeh.JPG
Notice that in the latter a broken VisualEditor link appears.
Expected: No VisualEditor link
Similarly if you go to the mobile site you will see the same problem - an edit link appears in square brackets rather than an edit icon (see bug 61807). The mobile skin uses doEditSectionLink which seems to be incompatible with FileRepo.
I've spent the morning talking with Brion to understand more about how the magic commons file page works and how the page is rendered.
Basically the problem is in FileRepo.php
getDescriptionRenderUrl creates an API request to something akin to https://commons.wikimedia.org/w/index.php?title=Image:Apthorp_south_jeh.JPG&action=render&uselang=en
If we can route this through the current skin this problem goes away.
e.g.
https://commons.wikimedia.org/w/index.php?title=Image:Apthorp_south_jeh.JPG&action=render&uselang=en&useformat=mobile
or
https://commons.wikimedia.org/w/index.php?title=Image:Apthorp_south_jeh.JPG&action=render&uselang=en&useskin=vector
Brion is taking a look to see if he can add a hook.
Version: 1.23.0
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=54259