Page MenuHomePhabricator

[Story] Use MediaViewer on commonsMedia properties on Wikibase repo
Closed, ResolvedPublic

Description

We currently have a default gadget that displays the image inline using jquery.ui (https://www.wikidata.org/wiki/MediaWiki:Gadget-CommonsMedia.js) but it would be much much cooler/better to use MediaViewer for this.

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 3:42 AM
bzimport set Reference to bz69456.
bzimport added a subscriber: Unknown Object (MLST).
Lydia_Pintscher removed a subscriber: Unknown Object (MLST).
Lydia_Pintscher removed a subscriber: Unknown Object (MLST).
Lydia_Pintscher renamed this task from Use MediaViewer on commonsMedia properties on Wikibase repo to [Story] Use MediaViewer on commonsMedia properties on Wikibase repo.Aug 13 2015, 7:12 PM
Lydia_Pintscher updated the task description. (Show Details)
Lydia_Pintscher set Security to None.
Lydia_Pintscher removed a subscriber: Wikidata-bugs.

Mass-removing the Multimedia tag from MediaViewer tasks, as this is now being worked on by the Reading department, not Editing's Multimedia team.

Related MV tasks: T59298: The viewer box should not depend on the current page, T77152: Support Developer Plugins/Gadgets in Media Viewer. @hoo if you have thoughts on what kind of hooks would be helpful please add it to that task!

@hoo: Can you add a link to the user script you wrote? Then I'll get it to editors and ask what they think.

If T46727: [Story] Statement should show a thumbnail for image/video/audio properties is resolved, we will get this for free :)

(Someone needs to disable the gadget in that case, though)

hoo claimed this task.

Once the thumbnails appear (that might need a page purge), MediaViewer will automatically pick them up.

Actually I was (slightly) wrong here, while MMV is going to pick up the images automatically, it does not automatically load.
This is because the loading of the required RL modules is not (automatically) triggered.

This is because MMV loads [ 'mmv.head', 'mmv.bootstrap.autostart' ] (for non-file pages) only if OutputPage::getFileSearchOptions is non-empty. But for Wikibase entities, getFileSearchOptions is empty, as we register images without sha1 or timestamp in ParserOutput::addImage. I'm not sure how to proceed here… I don't see how MMV would be able to find out whether images exist on a page. Maybe Wikibase should actually also set the sha1 and timestamp?

As a TEMPORARY workaround the following JavaScript could be added site-wide mw.loader.using( 'mmv.bootstrap.autostart' );.

Change 427285 had a related patch set uploaded (by Hoo man; owner: Hoo man):
[mediawiki/extensions/Wikibase@master] Properly add images via ParserOutput::addImage

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

Change 427285 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Properly add images via ParserOutput::addImage

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

hoo removed a project: Patch-For-Review.

Mentioned on wiki that the workaround can be removed on (or after) June 1st (when the change has been deployed long enough for all caches to be expired for sure).