The "Open in Media Viewer" box appears twice, one on top of the other, when viewed on file description pages using Mozilla Firefox 40.0.2 (the latest version).
Description
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Use wikipage.content hook for updating thumbnail list | mediawiki/extensions/MultimediaViewer | master | +9 -5 |
Related Objects
Event Timeline
Can't reproduce on 40.0 (which is the latest stable on Ubuntu). Do you see this on every wiki? Also when logged out?
It's intermittent. Sometimes there are two pairs; some times one, even on the same page. see https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)#Duplicate_media_viewer_links
No, I normally use MonoBook, but just now I switched to Vector, edited File:First Minister of Scotland, Nicola Sturgeon.jpg and immediately got two pairs of "Open in Media Viewer"/cogwheel link boxes above the "This file is unlicensed for use on Wikipedia" box. Also happened with the next two file description pages that I edited too (also Vector).
You mentioned editing on the village pump as well. Does this always happen after saving an edit?
@Tgr yes, I believe this is only after editing, and as far as I can tell it happens every time...
Possibly related to https://gerrit.wikimedia.org/r/#/c/231079 since not much else changed. Do we fire the postEdit hook even after a normal edit?
We do. Is there a reason you didn't use wikipage.content hook? (It is fired after the page is loaded or previewed, after a page is saved with VE and updated, and when it's previewed with live preview – generally every time when the page content is updated. ''mediawiki.page.image.pagination' fires it too, it seems, which you might also want to hook to.)
(Generally, wikipage.content hook is what you want to use if you were using the document-ready event previously, and now want to effortlessly support VE and live preview too.)
I didn't write that code but I would guess the reason is JS hooks are not documented anywhere and which one to use when is only passed down via oral tradition.
Thanks for doing that; I'll file a patch :)
Change 235176 had a related patch set uploaded (by Gergő Tisza):
Use wikipage.content hook for updating thumbnail list
The core JS hooks are actually documented at https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw.hook , which to be honest is a pretty sneaky place to document them.
Change 235176 merged by jenkins-bot:
Use wikipage.content hook for updating thumbnail list
Yes; sorry, the patch was not deployed separately. It will go out to Commons with the regular 1.26wmf21 deployment later today (see https://www.mediawiki.org/wiki/MediaWiki_1.26/Roadmap).