Last modified: 2014-05-30 14:56:22 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)
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.
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
Change 87715 merged by jenkins-bot: Don't break $wgFileExtensions structure when removing 'mp4' https://gerrit.wikimedia.org/r/87715
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?)
Change 132167 had a related patch set uploaded by MarkAHershberger: Don't break $wgFileExtensions structure when removing 'mp4' https://gerrit.wikimedia.org/r/132167
Change 132170 had a related patch set uploaded by MarkAHershberger: Don't break $wgFileExtensions structure when removing 'mp4' https://gerrit.wikimedia.org/r/132170
Couldn't merge to 1.19
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.
Change 132170 abandoned by MarkAHershberger: Don't break $wgFileExtensions structure when removing 'mp4' https://gerrit.wikimedia.org/r/132170
Change 132167 abandoned by MarkAHershberger: Don't break $wgFileExtensions structure when removing 'mp4' https://gerrit.wikimedia.org/r/132167