Page MenuHomePhabricator

Ajax "This file already exists" doesn't load image related js (e.g. from TMH)
Closed, ResolvedPublic

Description

Goto special:Upload, put in a file name that's an already existing TMH file. The "This file already exists" ajax warning doesn't load the js player, and falls back to native browser <audio> or <video> element.

Fairly minor issue, that may be difficult to fix, but ideally wouldn't happen.


Version: 1.22.0
Severity: minor

Details

Reference
bz49751

Event Timeline

bzimport raised the priority of this task from to Normal.Nov 22 2014, 2:02 AM
bzimport set Reference to bz49751.
bzimport added a subscriber: Unknown Object (MLST).
Bawolff created this task.Jun 18 2013, 3:21 PM

mdale wrote:

We support dynamic loading of the player, so we should be able to fix this.

(In reply to comment #1)

We support dynamic loading of the player, so we should be able to fix this.

I'm more thinking from the perspective that the interface on the MW core side is kind of klunky. OTOH, if the last remaining use of $wgAjaxExportList in core was removed and replaced with something better, I imagine that would make people happy for entirely other reasons.

mdale wrote:

MwEmbed modules include "loaders" that have some minimal code for invoking the async loading of all the components needed. i.e: we always export a $.fn.embedPlayer method[1] that can be run as soon as the video tag is in the DOM.

[1] https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FTimedMediaHandler/1864d1801f433562ce3e53a443d3f3196206b29a/MwEmbedModules%2FEmbedPlayer%2FEmbedPlayer.loader.js#L31

(In reply to comment #2)

(In reply to comment #1)

We support dynamic loading of the player, so we should be able to fix this.

I'm more thinking from the perspective that the interface on the MW core side
is kind of klunky. OTOH, if the last remaining use of $wgAjaxExportList in
core
was removed and replaced with something better, I imagine that would make
people happy for entirely other reasons.

I tried to do this in Gerrit change 65641

brion added a subscriber: brion.Jul 21 2015, 1:06 AM
Restricted Application added subscribers: Steinsplitter, Matanya, Aklapper. · View Herald TranscriptJul 21 2015, 1:06 AM
Jdforrester-WMF moved this task from Untriaged to Backlog on the Multimedia board.Sep 4 2015, 6:32 PM
Restricted Application added a project: Multimedia. · View Herald TranscriptSep 21 2015, 4:03 PM

Change 248710 had a related patch set uploaded (by TheDJ):
Special:Upload Fire wikipage.content hook

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

TheDJ added a subscriber: TheDJ.Oct 25 2015, 7:33 PM

This is what the upload page generates:

http://localhost/wiki/api.php?action=query&format=json&titles=File%3AFolgers-2%2Eogv&prop=imageinfo&iiprop=uploadwarning&indexpageids=true
"imageinfo": [{
                    "html": "<p>A file with this name exists already, please check <strong><a href=\"/wiki/index.php/File:Folgers-2.ogv\" title=\"File:Folgers-2.ogv\">File:Folgers-2.ogv</a></strong> if you are not sure if you want to change it.\n</p>\n<div class=\"thumb tright\"><div class=\"thumbinner\" style=\"width:202px;\"><div class=\"mediaContainer\" style=\"width:200px\"><video id=\"mwe_player_0\" style=\"width:200px;height:150px\" poster=\"/wiki/images/thumb/f/f7/Folgers-2.ogv/200px--Folgers-2.ogv.jpg\" controls=\"\" preload=\"none\" class=\"kskin\" data-durationhint=\"60\" data-startoffset=\"0\" data-mwtitle=\"Folgers-2.ogv\" data-mwprovider=\"local\"><source src=\"/wiki/images/f/f7/Folgers-2.ogv\" type=\"video/ogg; codecs=&quot;theora, vorbis&quot;\" data-title=\"Original Ogg file, 352 \u00d7 264 (637 kbps)\" data-shorttitle=\"Ogg source\" data-width=\"352\" data-height=\"264\" data-bandwidth=\"636645\" data-framerate=\"29.97002997003\" /><track kind=\"subtitles\" data-mwtitle=\"TimedText:Folgers-2.ogv.en.srt\" data-mwprovider=\"local\" type=\"text/x-srt\" src=\"http://localhost/wiki/index.php?title=TimedText:Folgers-2.ogv.en.srt&amp;action=raw&amp;ctype=text%2Fx-srt\" srclang=\"en\" data-dir=\"ltr\" label=\"English (en) subtitles\" />Sorry, your browser either has JavaScript disabled or does not have any supported player.<br /> You can <a href=\"/wiki/images/f/f7/Folgers-2.ogv\">download the clip</a> or <a href=\"https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:TimedMediaHandler/Client_download\">download a player</a> to play the clip in your browser.</video></div>  <div class=\"thumbcaption\"><div class=\"magnify\"><a href=\"/wiki/index.php/File:Folgers-2.ogv\" class=\"internal\" title=\"Enlarge\"></a></div></div></div></div>\n"
                }
                ]
TheDJ moved this task from Backlog to Player on the TimedMediaHandler board.Oct 25 2015, 7:33 PM
TheDJ moved this task from Player to Doing on the TimedMediaHandler board.

Change 248711 had a related patch set uploaded (by TheDJ):
Add TMH modules to the upload page.

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

Change 248710 merged by jenkins-bot:
Special:Upload Fire wikipage.content hook

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

TheDJ claimed this task.Oct 27 2015, 8:34 AM
TheDJ added a comment.May 12 2016, 7:09 AM

@matmarex I think it still requires https://gerrit.wikimedia.org/r/248711 ...not sure, haven't looked at it since oct.

Change 248711 merged by jenkins-bot:
Add TMH modules to the upload page.

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

matmarex closed this task as Resolved.May 17 2016, 4:54 AM

Fixed. :)

TheDJ moved this task from Doing to Done on the TimedMediaHandler board.May 18 2016, 8:15 PM