Last modified: 2012-05-15 14:26:15 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T3732, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 1732 - Unsupported operand types in includes/Parser.php on line 373
Unsupported operand types in includes/Parser.php on line 373
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.4.x
All Linux
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-03-22 10:43 UTC by Jean-Christian Imbeault
Modified: 2012-05-15 14:26 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Jean-Christian Imbeault 2005-03-22 10:43:48 UTC
While trying to get an extension to run I got the following in my apache error
logs. The extension worked fine in 1.3.10

[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/WEBTEAM/HEAD/mrw/Tools/src/:/home/imbeauje/WEBTEAM/HEAD/mrw/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 = "/home/imbeauje/j2sdk1.4.2_06/bin/java -classpath $CLASSPATH ".
         "com.mizuho.rws.tools.wikiTools.WikiDatabaseTableGenerator $dbName
$tableName";
  $output = `$cmd`;
  $output = $wgParser->internalParse($output, 0);
  return $output;
}
?>
Comment 1 Jean-Christian Imbeault 2005-03-28 01:59:28 UTC
I was able to fix my extension by using this instead to parse the wiki text:

$output = $wgParser->parse( $output, $wgTitle, $wgOut->mParserOptions, true );
return $output->getText();

Still don't know why my code broke from 1.3.10 to 1.4.0 though.
Comment 2 Antoine "hashar" Musso (WMF) 2005-03-28 02:08:39 UTC
$wgParser->internalParse is marked as private and is used internaly
by the parser. $wgParser->parse is the way to go :)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links