Page MenuHomePhabricator

The 1.5.8+ parser function generates an error on the 1.6.6 release.
Closed, InvalidPublic

Description

Author: drkludge

Description:
I was modifying the calc extension to see how to make a mediawiki extension. I
followed the doc right above the function
http://meta.wikimedia.org/wiki/Extending_wiki_markup#Installing_the_extension
link. I added the new parser variable using &$parser as per the FAQ here
http://meta.wikimedia.org/wiki/MediaWiki_extensions_FAQ#How_do_I_render_wikitext_in_my_extension.3F
The new function call looks like this
function doMath( $input, $argv, &$refParser158 ) {
}

The suggested function call of
$calc_data = $refParser158->parse($input, false);

Produces
[Tue Jun 06 18:56:12 2006] [error] [client 127.0.0.1] PHP Fatal error:
Cannot pass parameter 2 by reference in
/var/www/mediawiki16/extensions/calc/calc.php on line 79, referer:
http://localhost/mediawiki16/index.php?title=Main_Page&action=edit&section=3
in the /var/log/httpd/error_log and I thick the page did not render.

The work around is to use existing pre 1.5.8 setup and call.
global $wgOut;
....
$calc_data = $wgOut->parse($input, false);

I see 1.6.7 just came out so I do not know if it solves the problem. google and
media wiki searches did not return any hits but that's not the easiest error
message to query for.

Version info.

  1. MediaWiki: 1.6.6
  2. PHP: 5.1.2 (apache2handler)
  3. MySQL: 5.0.21
  4. Fedora Core 5.

Version: unspecified
Severity: normal
OS: Linux
Platform: PC
URL: http://meta.wikimedia.org/wiki/Extending_wiki_markup#Installing_the_extension

Details

Reference
bz6228

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:17 PM
bzimport set Reference to bz6228.
bzimport added a subscriber: Unknown Object (MLST).

Please see the code of existing extensions for examples that actually work.