Page MenuHomePhabricator

"Open in Media Viewer" box appears twice after editing file page
Closed, ResolvedPublic

Description

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).

Event Timeline

Jacklee raised the priority of this task from to Low.
Jacklee updated the task description. (Show Details)
Jacklee added a project: Commons.
Jacklee subscribed.
Steinsplitter added a project: MediaViewer.
Steinsplitter set Security to None.
Steinsplitter raised the priority of this task from Low to Needs Triage.Aug 27 2015, 10:47 AM

Can't reproduce on 40.0 (which is the latest stable on Ubuntu). Do you see this on every wiki? Also when logged out?

I don't see the problem when using Safari on my iPad.

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...

Have just found that English Wikipedia is affected as well as Commons

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

https://gerrit.wikimedia.org/r/235176

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

https://gerrit.wikimedia.org/r/235176

matmarex renamed this task from "Open in Media Viewer" box appears twice to "Open in Media Viewer" box appears twice after editing file page.Sep 1 2015, 1:54 PM
matmarex closed this task as Resolved.
matmarex assigned this task to Tgr.
matmarex triaged this task as High priority.
matmarex removed a project: Patch-For-Review.

This still happens to me on Commons today (Chrome, Win7).

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).

@Yann, it should be resolved on Commons now. Can you confirm? Thanks.