Last modified: 2014-05-30 14:56:22 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T57366, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 55366 - TimedMediaHandler breaks UploadWizard if $wgFileExtensions redefined...
TimedMediaHandler breaks UploadWizard if $wgFileExtensions redefined...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
TimedMediaHandler (Other open bugs)
master
All All
: Normal minor (vote)
: MW 1.23 version
Assigned To: Bartosz Dziewoński
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-06 13:11 UTC by Kelson [Emmanuel Engelhart]
Modified: 2014-05-30 14:56 UTC (History)
8 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---
matma.rex: Backport_to_Stable-


Attachments

Description Kelson [Emmanuel Engelhart] 2013-10-06 13:11:24 UTC
In your LocalSettings.php, if you configure things in the following order:
1 - require_once("$IP/extensions/UploadWizard/UploadWizard.php");
2 - require_once("$IP/extensions/TimedMediaHandler/TimedMediaHandler.php");
3 - $wgFileExtensions = array_merge( $wgFileExtensions, array( 'doc', 'docx' ) );

Then, you won't be able to use the UploadWizard *at all*. If will always fail with the following javascript error:
This wiki does not accept filenames that end in the extension ".xxx".

If you change $wgFileExtensions before requiring TimedMediaHandler.php, then it works like a charm.

MediaWiki 	1.21.2
PHP 	5.3.10-1ubuntu3.8 (fpm-fcgi)
MySQL 	5.5.28-0ubuntu0.12.04.2
Upload Wizard (Version 1.3)
TimedMediaHandler (Version 0.3)
Comment 1 Bartosz Dziewoński 2013-10-06 13:26:35 UTC
This is because TimedMediaHandler touches the $wgFileExtensions array in an inappropriate way.

		// Remove mp4 if not enabled:
		if( $wgTmhEnableMp4Uploads === false ){
			foreach( $wgFileExtensions as $inx => $val ) {
				if( $val == 'mp4' ){
					unset( $wgFileExtensions[$inx] );
				}
			}
		}

This piece of code causes a certain value in that array to be missing. PHP accepts it (since its arrays are also maps), but this results in the array being serialized to JavaScript as an object, not an array, breaking UploadWizard which expects the latter.
Comment 2 Gerrit Notification Bot 2013-10-06 13:35:19 UTC
Change 87715 had a related patch set uploaded by Bartosz Dziewoński:
Don't break $wgFileExtensions structure when removing 'mp4'

https://gerrit.wikimedia.org/r/87715
Comment 3 Gerrit Notification Bot 2013-10-28 05:07:35 UTC
Change 87715 merged by jenkins-bot:
Don't break $wgFileExtensions structure when removing 'mp4'

https://gerrit.wikimedia.org/r/87715
Comment 4 Bartosz Dziewoński 2013-10-28 07:50:27 UTC
Done. I wonder if it should be backported to the 1.21 branch? Is the 'master' version of TimedMediaHandler compatible with MediaWiki 1.21? (Kelson?)
Comment 5 Gerrit Notification Bot 2014-05-08 09:11:04 UTC
Change 132167 had a related patch set uploaded by MarkAHershberger:
Don't break $wgFileExtensions structure when removing 'mp4'

https://gerrit.wikimedia.org/r/132167
Comment 6 Gerrit Notification Bot 2014-05-08 09:12:34 UTC
Change 132170 had a related patch set uploaded by MarkAHershberger:
Don't break $wgFileExtensions structure when removing 'mp4'

https://gerrit.wikimedia.org/r/132170
Comment 7 Mark A. Hershberger 2014-05-08 09:13:25 UTC
Couldn't merge to 1.19
Comment 8 Mark A. Hershberger 2014-05-08 10:08:04 UTC
The cherry picks that did work resulted in failing tests.  That means this is available if someone wants to look into it, but I cannot spend more time on it right now.
Comment 9 Gerrit Notification Bot 2014-05-27 16:45:36 UTC
Change 132170 abandoned by MarkAHershberger:
Don't break $wgFileExtensions structure when removing 'mp4'

https://gerrit.wikimedia.org/r/132170
Comment 10 Gerrit Notification Bot 2014-05-27 16:46:00 UTC
Change 132167 abandoned by MarkAHershberger:
Don't break $wgFileExtensions structure when removing 'mp4'

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links