Last modified: 2008-05-22 09:09:37 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 T16214, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 14214 - Randomimage tags do not render an image
Randomimage tags do not render an image
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
RandomImage (Other open bugs)
unspecified
Macintosh All
: Normal normal (vote)
: ---
Assigned To: Roan Kattouw
http://organicdesign.co.nz/wiki/index...
: easy, patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-05-21 19:49 UTC by Zven
Modified: 2008-05-22 09:09 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Patches as documented in http://www.mediawiki.org/wiki/Extension_talk:RandomImage (6.76 KB, patch)
2008-05-21 21:47 UTC, Zven
Details
Real patch (2.61 KB, patch)
2008-05-21 21:55 UTC, Roan Kattouw
Details
Better patch that doesn't change tabs to spaces all over the place (1.36 KB, patch)
2008-05-21 22:02 UTC, Roan Kattouw
Details

Description Zven 2008-05-21 19:49:05 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.
Comment 1 Zven 2008-05-21 21:47:32 UTC
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
Comment 2 Roan Kattouw 2008-05-21 21:55:59 UTC
Created attachment 4912 [details]
Real patch

That's not a patch, *this* is a patch
Comment 3 Roan Kattouw 2008-05-21 22:02:27 UTC
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.
Comment 4 Roan Kattouw 2008-05-22 09:09:37 UTC
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.

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


Navigation
Links