Page MenuHomePhabricator

Gallery styles missing on local file description pages
Open, Needs TriagePublic

Description

The style for <gallery> is not anymore loaded when in File namespace the page is transcluded from a file repo like Wikimedia Commons.

Compare

https://de.wikipedia.org/wiki/Datei:Coax_to_10BaseT_Converter_-_Milan_Model_MIL_120A-2695.jpg

with

https://commons.wikimedia.org/wiki/File:Coax_to_10BaseT_Converter_-_Milan_Model_MIL_120A-2695.jpg

Probably a regression from Ib1aef04dc4fece78e6615386ecaef6a9f368f49e (Only load gallery styling rules when galleries are on the page)

Event Timeline

Raymond created this task.Nov 16 2015, 2:55 PM
Raymond raised the priority of this task from to Needs Triage.
Raymond updated the task description. (Show Details)
Raymond added a subscriber: Raymond.
Restricted Application added subscribers: StudiesWorld, Steinsplitter, Aklapper. · View Herald TranscriptNov 16 2015, 2:55 PM

... which was merged in August, how come this bug was not noticed?

rMW7c702db019f363237aa893c13f333acc71ab1eaf, actually, which is a follow-up to that one (and only a month old).

So… do foreign repositories still use index.php?action=raw, rather than api.php?action=parse? If so, this is not going to work, and it has never worked with other features that require custom styles (like <syntaxhighlight> or Babel extension boxes). It just so happens that most of those cases were in extensions and not in core so far.

(They still do, the code is in FileRepo::getDescriptionRenderUrl and File::getDescriptionText. It essentially loads and embeds https://commons.wikimedia.org/w/index.php?title=File:Coax_to_10BaseT_Converter_-_Milan_Model_MIL_120A-2695.jpg&action=render, which – as you can see – has no styles associated.)

We probably want to migrate it to using API's action=parse like GlobalUserPage is doing, but that'll cause issues due to T42128.

Also also, we should be careful about loading modules based on a foreign parser. It may sort-of work for more stable modules from MediaWiki core and extensions, but I'm not sure it's the right approach to load local modules by the same name.

They will be different versions within Wikimedia (unless the client wiki and Commons are in the same group). And for third parties there can be much wider discrepancies. Unless we consider these "low-priority enhancements", that means we need to keep them in mentioned in the parser to third-parties until the oldest supported version supports the new module name, for example.

Also also, we should be careful about loading modules based on a foreign parser.

Should the modules get also loaded from the foreign wiki?

Restricted Application added a subscriber: Poyekhali. · View Herald TranscriptApr 19 2016, 12:34 PM
matmarex set Security to None.May 9 2016, 3:27 PM
matmarex edited subscribers, added: Jdlrobson; removed: Konfused-Kitten.
Krinkle renamed this task from [Regression] gallery style not loaded when page is transcluded from forein file repo to Gallery styles missing on local file description pages.Jul 11 2016, 10:20 PM
dr0ptp4kt moved this task from Untriaged to Tracking on the Multimedia board.Aug 21 2017, 4:28 PM
dr0ptp4kt added subscribers: dpatrick, dr0ptp4kt.

@dpatrick bringing to your attention in case this is something your team might want to weigh in on.