Last modified: 2008-05-22 09:09:37 UTC
Note: Similar bug request at: https://bugzilla.wikimedia.org/show_bug.cgi?id=14168 The <randomimage> tags do not return an image; Non working illustration (mediawiki 1.11.0): http://organicdesign.co.nz/wiki/index.php?title=Sandbox&action=edit Bug fixed illustration (mediawiki 1.12.0) : http://1120.organicdesign.co.nz/wiki/index.php?title=Sandbox&action=edit I have put suggested a bug fix on the discussion page at MediaWiki changes are not yet in SVN; http://www.mediawiki.org/w/index.php?title=Extension_talk%3ARandomImage&diff=168670&oldid=58511 At the time of writing these suggestions the SVN revision was R30825, it is now R34306 for the RandomImage directory. There was a minor bug fixed in line 45 of the RandomImage.php file; $wgparser->setHook( 'randomimage', 'RandomImage::renderHook' ); changed to $wgParser->setHook( 'randomimage', array('RandomImage', 'renderHook')); which allowed the method to be accessible. the other suggested changes are in the attached RandomImage.class.php file. This has not been tested on the latest MediaWiki development release, only the latest stable release.
Created attachment 4911 [details] Patches as documented in http://www.mediawiki.org/wiki/Extension_talk:RandomImage There still seems to be an issue with a tag with does not close e.g. <randomimage> will cause warnings on line 118 of RandomImage.class.php
Created attachment 4912 [details] Real patch That's not a patch, *this* is a patch
Created attachment 4913 [details] Better patch that doesn't change tabs to spaces all over the place Improved the patch, it changed tabs to spaces throughout a function. You probably wanna configure your editor to use tabs for indentation rather that 8 spaces (or 2 or 4 or whatever crazy things it does). As to the changes themselves: they seem sane, and I can't imagine them breaking the current SVN version. I'll test it tomorrow anyway, to be sure.
Patch applied in r35176. It throws an E_NOTICE about DOMDocument::loadHTML() not being a static method, but that seems to be a bug in PHP rather than this extension, as the PHP manual explicitly states that this method can also be called statically.