$wgParser is a global that has to be both created before you use it, and declared as a global. Did you forget either of those? You can also create a new parser inside your extension.
JH
On Sep 10, 2007, at 9:42 AM, Andreas Rindler wrote:
Hi, I am trying to include another extension in my own extension. I need to parse the other extension as wikitext, but it doesn't work.
I am extending http://www.mediawiki.org/wiki/ Extension:SelectCategoryTagCloud to include not only a tag cloud, but also a hierarchical view on categories. Instead of writing the code from scratch, I would like to reuse http://www.mediawiki.org/wiki/Extension:CategoryTree. I am trying to include the <categorytree> tags in the area where the tag cloud is. Users would then be able to select categories from the categorytree and assign them to the article.
I have used the following code, but I get an error.
$outputtext = $wgParser->recursiveTagParse("<categorytree depth="2" onlyroot="on" mode="all" style="float:none; margin-left:1ex; border:1px solid gray; padding:0.7ex; background-color:white;">My Category</categorytree>");
The error is: Fatal error: Call to a member function getUseTeX() on a non-object in D:\Apache2.2\htdocs\mike2\includes\Parser.php on line 551
Just to clarify, I have a hook extension where I need to make sure that the wikitext is parsed before I include it in the output of the extension.
How can I get rid of the error? Or does anyone have other suggestions?
Thanks, Andi
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054