Having upgraded to 1.9.3, I find that the Calendar extension that I used to use ( http://www.mediawiki.org/wiki/Extension:Calendar_%28Shane%29_extended ) no longer works. A number of users have noted this on the Discussion page: what happens id that instead of a calendar, on gets a string like UNIQ391290e6c0cc0c1-calendar-00000001-QINU I have googled around, but found no clear solution. The sanest advice seemed to be at: http://meta.wikimedia.org/wiki/QINU_fix In line with this, I changed the calendar extension code from the commented out lines to:
// global $wgOut; // $input = $wgOut->parse($input, false); $input = $parser->parse($input, $parser->mTitle, $parser->mOptions, false, false); $array = explode(' ', $input);
But now PHP complains that [Sat Apr 28 21:23:57 2007] [error] PHP Fatal error: Call to a member function getUseTeX() on a non-object in /opt/csw/apache/htdocs/mediawiki-1.9.3/includes/Parser.php on line 550 And investigation in Parser.php suggests that the problem is that $parser->mOptions is not an object as expected, but null.
I'm thrashing around here. Can anyone give me some help to get this working? I can code in PHP, but don't know a lot about the mediawiki internals.
Nigel
________________________________________________________________ Professor Nigel Gilbert, ScD, FREng, AcSS, Professor of Sociology, University of Surrey, Guildford GU2 7XH, UK. +44 (0)1483 689173
I've got the same problem some time ago, however with diff extension. Have you declared:
globab $wgParser? and have a try with:
global $wgOut, $wgTitle, $wgParser;
//define parser
$localParser = new Parser();
$input = $localParser->parse($out, $wgTitle, $wgOut->mParserOptions, false);
$array = explode(' ', $input); Note you have to create a new object Parser();
Regards, Aretai
On 4/28/07, Nigel Gilbert n.gilbert@surrey.ac.uk wrote:
Having upgraded to 1.9.3, I find that the Calendar extension that I used to use ( http://www.mediawiki.org/wiki/Extension:Calendar_%28Shane%29_extended ) no longer works. A number of users have noted this on the Discussion page: what happens id that instead of a calendar, on gets a string like UNIQ391290e6c0cc0c1-calendar-00000001-QINU I have googled around, but found no clear solution. The sanest advice seemed to be at: http://meta.wikimedia.org/wiki/QINU_fix In line with this, I changed the calendar extension code from the commented out lines to:
// global $wgOut; // $input = $wgOut->parse($input, false); $input = $parser->parse($input, $parser->mTitle, $parser->mOptions, false, false); $array = explode(' ', $input);
But now PHP complains that [Sat Apr 28 21:23:57 2007] [error] PHP Fatal error: Call to a member function getUseTeX() on a non-object in /opt/csw/apache/htdocs/mediawiki-1.9.3/includes/Parser.php on line 550 And investigation in Parser.php suggests that the problem is that $parser->mOptions is not an object as expected, but null.
I'm thrashing around here. Can anyone give me some help to get this working? I can code in PHP, but don't know a lot about the mediawiki internals.
Nigel
Professor Nigel Gilbert, ScD, FREng, AcSS, Professor of Sociology, University of Surrey, Guildford GU2 7XH, UK. +44 (0)1483 689173
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
On 30/04/07, aretai aretai aretaiuc@gmail.com wrote:
$array = explode(' ', $input); Note you have to create a new object Parser();
Depending on the circumstances, it might be possible to reuse the existing reference to the parent parser (third argument to the hook function) to do the parsing, thus ensuring things like links, etc. are kept in the ParserOutput. You can look at extensions such as Poem and Cite to see how this might be done.
If that's not the case, then you need to use a *clone* of the existing parser, assuming you don't want it to forget about existing hook extensions, etc. and other configuration settings applied to the $wgParser object.
This can be done with the line:
$localParser = clone $parser;
Rob Church
Thanks to all who helped me get 'Extension:Calendar (Shane) extended' working with version 1.9.3, by changing the calls to the Parser. I have edited the Extension page to add the amended code.
Nigel Gilbert
On 30/4/07 16:53, "Rob Church" robchur@gmail.com wrote:
On 30/04/07, aretai aretai aretaiuc@gmail.com wrote:
$array = explode(' ', $input); Note you have to create a new object Parser();
Depending on the circumstances, it might be possible to reuse the existing reference to the parent parser (third argument to the hook function) to do the parsing, thus ensuring things like links, etc. are kept in the ParserOutput. You can look at extensions such as Poem and Cite to see how this might be done.
If that's not the case, then you need to use a *clone* of the existing parser, assuming you don't want it to forget about existing hook extensions, etc. and other configuration settings applied to the $wgParser object.
This can be done with the line:
$localParser = clone $parser;
Rob Church
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
________________________________________________________________ Professor Nigel Gilbert, ScD, FREng, AcSS, Professor of Sociology, University of Surrey, Guildford GU2 7XH, UK. +44 (0)1483 689173
mediawiki-l@lists.wikimedia.org