Cindy Cicalese wrote:
The first issue is that I need access to the parser in
the Ajax callback so I
can call recursiveTagParse on the results for the query. I tried using
$wgParser, but it does not appear to be in a good state in the callback. I had a
series of errors where the parser was calling functions on non-objects. I played
around with it a bit and was able to get past all of these errors with this
rather ugly code:
global $wgParser;
$wgParser->mOptions = new ParserOptions;
$wgParser->initialiseVariables();
$wgParser->clearState();
$wgParser->setTitle(new Title($title));
You are not expected to use recursiveTagParse() not being called by the
Parser. You are initializing the parser by hand.
Try instead using $wgParser->parse()