Page MenuHomePhabricator

Special:NewFiles displays error messages
Open, Needs TriagePublicBUG REPORT

Description

Currently, when I go to https://lingualibre.org/wiki/Special:NewFiles, I see several lines such as

Notice: Undefined offset: 0 in /home/www/lingualibre.org/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscode.php on line 1009

Notice: Undefined offset: 1 in /home/www/lingualibre.org/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscode.php on line 1009

Warning: Cannot modify header information - headers already sent by (output started at /home/www/lingualibre.org/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscode.php:1009) in /home/www/lingualibre.org/includes/WebResponse.php on line 46

Instead I should see the latest items that have been created.

Event Timeline

Pamputt created this task.Tue, Oct 6, 7:32 PM

Wiki using 1.31 and the TimedMediaHandler extension seems also the corresponding 1.31 release

Code is:

	/**
	 * Check if the given transcode key is appropriate for the file.
	 *
	 * @param File $file File object
	 * @param string $transcodeKey transcode key
	 * @return bool
	 */
	public static function isTranscodeEnabled( File $file, $transcodeKey ) {
		$audio = $file->getHandler()->isAudio( $file );
		if ( $audio ) {
			$keys = self::enabledAudioTranscodes();
		} else {
			$keys = self::enabledVideoTranscodes();
		}

		if ( in_array( $transcodeKey, $keys ) ) {
			$settings = self::$derivativeSettings[$transcodeKey];  <!-- error line
			if ( $audio ) {
				$sourceCodecs = $file->getHandler()->getStreamTypes( $file );
				$sourceCodec = $sourceCodecs ? strtolower( $sourceCodecs[0] ) : '';
				return ( $sourceCodec !== $settings['audioCodec'] );
			} elseif ( self::isTargetLargerThanFile( $file, $settings['maxSize'] ) ) {
				// Are we the smallest enabled transcode for this type?
				// Then go ahead and make a wee little transcode for compat.
				return self::isSmallestTranscodeForCodec( $transcodeKey );
			} else {
				return true;
			}
		} else {
			// Transcode key is invalid or has been disabled.
			return false;
		}
	}

the $transcodeKey should be something like 160p.webm. Have you set own $wgEnabledTranscodeSet or $wgEnabledAudioTranscodeSet? It seems the in_array check allows some bools to get through. The last changes for the 1.31 release was to change both config from list to map (https://gerrit.wikimedia.org/r/c/mediawiki/extensions/TimedMediaHandler/+/451042), maybe something wrong in your LocalSettings.php

This is also shown on each image page - for example https://lingualibre.org/wiki/File:D8vhrq.wav

I am not sure, but you should not running a production wiki with errors showing like this. The errors should only the the logs