I posted this a few days ago but didn't get a response. I'm reposted in the hopes that my original post was missed.
I've upgraded from 1.3.10 to 1.4.0 and one of my extensions no longer works.
I think the problem might have to do with my use of:
$wgParser->internalParse($output, 0)
While trying to get an extension to run I got the following in my apache error logs.
[error] PHP Warning: end(): Passed variable is not an array or object in /home/imbeauje/apache/htdocs/wiki/includes/Parser.php on line 425 [error] PHP Warning: end(): Passed variable is not an array or object in /home/imbeauje/apache/htdocs/wiki/includes/Parser.php on line 425 [error] PHP Warning: end(): Passed variable is not an array or object in /home/imbeauje/apache/htdocs/wiki/includes/Parser.php on line 425 [error] PHP Warning: end(): Passed variable is not an array or object in /home/imbeauje/apache/htdocs/wiki/includes/Parser.php on line 425 [error] PHP Notice: Undefined index: html in /home/imbeauje/apache/htdocs/wiki/includes/Parser.php on line 373 [error] PHP Fatal error: Unsupported operand types in /home/imbeauje/apache/htdocs/wiki/includes/Parser.php on line 373
In case it is useful here is my extension:
$wgExtensionFunctions[] = "wfTableSchema";
function wfTableSchema() { global $wgParser; $wgParser->setHook( "tableSchema", "renderTableSchema" ); }
function renderTableSchema( $input ) { global $wgTitle, $wgParser; $CLASSPATH = "/home/imbeauje/src/:/home/imbeauje/Tools/lib/jconn2.jar"; $title = $wgTitle->getDBkey(); //title is of the form database..tableName. Parse to extract list($dbName, $tableName) = explode("..", $title); $dbName = strtolower($dbName); //then pass as params to java prog that will generate table $cmd = "java -classpath $CLASSPATH ". "wikiTools.WikiDatabaseTableGenerator $dbName $tableName"; $output = `$cmd`; $output = $wgParser->internalParse($output, 0); return $output; } ?>
I've also filed this in bugzilla at:
http://bugzilla.wikimedia.org/show_bug.cgi?id=1732
Jc
Yes. Unfortunately, Parser::internalParse isn't actually supposed to be called from anywhere other than the parser itself. It's just convieniant to parse arbitray Wikitax.
All I can recomend is to add some code that changes the call based on the version.
On Thu, 24 Mar 2005 09:39:55 +0900, Jean-Christian Imbeault jci@gol.com wrote:
I posted this a few days ago but didn't get a response. I'm reposted in the hopes that my original post was missed.
I've upgraded from 1.3.10 to 1.4.0 and one of my extensions no longer works.
I think the problem might have to do with my use of:
$wgParser->internalParse($output, 0)
While trying to get an extension to run I got the following in my apache error logs.
[error] PHP Warning: end(): Passed variable is not an array or object in /home/imbeauje/apache/htdocs/wiki/includes/Parser.php on line 425 [error] PHP Warning: end(): Passed variable is not an array or object in /home/imbeauje/apache/htdocs/wiki/includes/Parser.php on line 425 [error] PHP Warning: end(): Passed variable is not an array or object in /home/imbeauje/apache/htdocs/wiki/includes/Parser.php on line 425 [error] PHP Warning: end(): Passed variable is not an array or object in /home/imbeauje/apache/htdocs/wiki/includes/Parser.php on line 425 [error] PHP Notice: Undefined index: html in /home/imbeauje/apache/htdocs/wiki/includes/Parser.php on line 373 [error] PHP Fatal error: Unsupported operand types in /home/imbeauje/apache/htdocs/wiki/includes/Parser.php on line 373
In case it is useful here is my extension:
$wgExtensionFunctions[] = "wfTableSchema";
function wfTableSchema() { global $wgParser; $wgParser->setHook( "tableSchema", "renderTableSchema" ); }
function renderTableSchema( $input ) { global $wgTitle, $wgParser; $CLASSPATH = "/home/imbeauje/src/:/home/imbeauje/Tools/lib/jconn2.jar"; $title = $wgTitle->getDBkey(); //title is of the form database..tableName. Parse to extract list($dbName, $tableName) = explode("..", $title); $dbName = strtolower($dbName); //then pass as params to java prog that will generate table $cmd = "java -classpath $CLASSPATH ". "wikiTools.WikiDatabaseTableGenerator $dbName $tableName"; $output = `$cmd`; $output = $wgParser->internalParse($output, 0); return $output; } ?>
I've also filed this in bugzilla at:
http://bugzilla.wikimedia.org/show_bug.cgi?id=1732
Jc
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org