Quantcast
Channel: User i alarmed alien - Stack Overflow
Viewing all articles
Browse latest Browse all 42

Returning results from a custom MediaWiki hook

$
0
0

I'm hacking an existing MediaWiki extension, ProcessCite, that adds a custom hook to the Cite extension. Since migrating to PHP 5.4 and MW 1.22 (from PHP 5.3 and MW 1.19.2), the extension does not appear to work correctly. The problem is with the custom hook not returning the data it should do.

Here are the relevant parts of the code:

ProcessCite.php

# Declare the hook:$wgHooks['CiteBeforeStackEntry'][] = 'wfProcessCite';# the function itselffunction wfProcessCite($str, $argv){# process $argv and $str to create a new version of $str# $argv remains unchanged, $str is set to new value  ...  $str = "new string";  return true;}

in Cite_body.php

function stack( $str, $key = null, $group, $follow, $call ) {  # add the call to the CiteBeforeStackEntry hook  wfRunHooks( 'CiteBeforeStackEntry', array( &$str, &$call ) );

I've added debugging statements to the beginning and end of wfProcessCite, which show that $str is being altered; however, debug statements before and after wfRunHooksshow no change to $str.

Can anyone help?


Viewing all articles
Browse latest Browse all 42

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>