Page MenuHomePhabricator

Edit link inconsistencies on Foreign file pages - skins which use doEditSectionLink incompatible with FileRepo
Closed, ResolvedPublic

Description

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

Details

Reference
bz62071

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:05 AM
bzimport set Reference to bz62071.
bzimport added a subscriber: Unknown Object (MLST).

Apologies for the brain dump - I hope this is relatively clear.

That sounds like a VE/mobile bug, the links generated by core work just fine.

The VE bug for this is bug 54259.

Thanks for clarifying the VE issue is a different problem.

Compare results of
https://commons.wikimedia.org/w/index.php?title=Image:Apthorp_south_jeh.JPG&action=render&uselang=en&useskin=vector
https://commons.wikimedia.org/w/index.php?title=Image:Apthorp_south_jeh.JPG&action=render&uselang=en&useformat=mobile
(triggers useskin=minerva but minerva is unregistered so this is needed)

The MinervaSkin overrides doEditSectionLink. There may be other skins that also override it and will thus be inconsistent.

Hmm. You seem to be requesting the same thing as bug 19415 here – I already tried to fix it once, but there were complications. There's a patch there that needs to be reworked.

(On a side note, my personal opinion about doEditSectionLink is that it should die in a fire and you should style the section edit links with CSS, as I made it possible to easily hide the brackets a few months ago.)

Actually in the case of the file page we would like to render the edit links and make it possible to edit the content (albeit on a foreign wiki)

So really it would be great if this could just pass the current skin name along with the request..

Making FileRepo stuff depend on current skin would be horrible, also there's a problem with permissions/being logged in on foreign wiki which makes displaying edit links unreliable. However, I redid Bartosz's fix for bug 19415 in https://gerrit.wikimedia.org/r/#/c/118135/

Making FileRepo stuff depend on current skin would be horrible, also there's a problem with permissions/being logged in on foreign wiki which makes displaying edit links unreliable. However, I redid Bartosz's fix for bug 19415 (T21415) in https://gerrit.wikimedia.org/r/#/c/118135/

Apparently, this never worked for File pages. I just fixed that with https://gerrit.wikimedia.org/r/468203. Since there will be no more section edit links in file descriptions fetched from foreign repo, I think we can consider this resolved.