Page MenuHomePhabricator

Media Descriptions Imported From Commons
Closed, DeclinedPublic

Description

On this page, the file description imported from commons includes a link to an .ogg file. This creates a control to play the file but the control causes a javascript error when clicked.


Version: unspecified
Severity: normal
URL: http://en.wikipedia.org/wiki/Image:Bassoon-octaves-spectrogram.png

Details

Reference
bz11289

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:56 PM
bzimport set Reference to bz11289.
bzimport added a subscriber: Unknown Object (MLST).

Error: wgOggPlayer is not defined
Source File: http://en.wikipedia.org/wiki/Image:Bassoon-octaves-spectrogram.png
Line: 1

Looks like it's pulling the HTML of the description page, which includes a player via this link:
[[Image:Bassoon-technical-bflatoctaves.ogg]]

but the head scripts aren't included, so the OggPlayer.js doesn't get loaded.

Crappy workaround is to add:

if(strpos($this->mExtraDescription, 'wgOggPlayer') !== false && class_exists('OggHandler')) {

OggHandler::setHeaders($wgOut);

}

to line 76 of ImagePage.php inside the if($this->mExtraDescription) block in the view function.

Other options:

  1. OggHandler could attach to a hook in output page and checked for the existence of 'wgOggPlayer' in the text that's about to be outputted.
  2. The wgOggPlayer javascript that's throwing the error could be wrapped in an if('wgOggPlayer') block. This should probably be done anyway. The control would then be useless in a situation like this but at least it wouldn't throw errors.
  3. A new hook could be fired from ImagePage->view() or lower in the FileRepo code when a file description is imported from a foreign source which extensions could then catch.

(In reply to comment #2)

  1. The wgOggPlayer javascript that's throwing the error could be wrapped in an

if('wgOggPlayer') block. This should probably be done anyway. The control
would then be useless in a situation like this but at least it wouldn't throw
errors.

Did this in r41732. Ideally I'd like to have interwiki transclusion and commons description transclusion use a more information-rich interface than action=render. Something similar to a serialized ParserOutput would be good.

The OggHandler extension is not under active development anymore. It is unlikely that there will be any further active development.

OggHandler has been superseded by TimedMediaHandler:

http://www.mediawiki.org/wiki/Extension:TimedMediaHandler

Please use TimedMediaHandler instead.

Closing this report as WONTFIX as part of Bugzilla Housekeeping.

Please feel free to reopen this bug report in the future if either anyone takes the responsibility for active development of OggHandler again; or move this bug report from the "OggHandler" to the "TimedMediaHandler" component in Bugzilla if the same problem still happens when using TimedMediaHandler. Thanks.

I would actually consider this fixed since the functionality at the link in the original report now works just fine (thanks to TimedMediaHandler)...