Topic on Extension talk:EmbedVideo

Error message regarding AudioTransformOutput.php

4
Summary by Seb35

Fixed in merge request 139.

Maf654321 (talkcontribs)

On MediaWiki 1.35.2, I have error reporting on, and on every page that contains an embedded audio clip, there is an error message reading as such:

Notice: Undefined variable: class in /var/www/html/extensions/EmbedVideo/classes/media/AudioTransformOutput.php on line 102

Looking online, quite a few other wikis with EmbedAudio seem to be having error messages (if they have left the error reporting on), though, as with mine, functionality seems intact. Any ideas as to what's going on?

Kghbln (talkcontribs)
SemanticPioneer (talkcontribs)

Just add:

$class = "";

in file extensions\EmbedVideo\classes\media\AudioTransformOutput.php

before

if (!empty($options['img-class'])) {

The same error is in extensions\EmbedVideo\classes\media\VideoTransformOutput.php.

The reason is simple: the function returns the media class at the end of the file. If this class does not exist, the function does not create an empty class variable, but still tries to return it: D


Moreover, I think this line, at the end of the function in above files is not correct too:

'class' => $class ?: false,

I think it should be

'class' => $class ? $class : false,

Seb35 (talkcontribs)

This error was fixed in the merge request 139, but it is only in the branch master: for now no official version was issued containing this patch, so you have to apply yourself the patch or use Git to follow the master branch.