Page 1 of 1

Fatal Error! D:

Posted: Fri Jan 21, 2011 5:21 pm
by wildman616
Well, I'm new to these forums. I joined because I'm having trouble with some code.
I get this error:
Fatal error: Unsupported operand types in /home/a8812665/public_html/extensions/Collection/Collection.php on line 192
Here's the code around 192.

This starts at line 173

Code: Select all

$wgResourceModules += array(
	'ext.collection.jquery.json' => $collResourceTemplate + array(
		'scripts' => 'jquery.json.js'
	),
	'ext.collection.jquery.jstorage' => $collResourceTemplate + array(
		'scripts' => 'jstorage.js',
		'dependencies' => 'ext.collection.jquery.json'
	),
	'ext.collection.suggest' => $collResourceTemplate + array(
		'scripts' => 'suggest.js',
		'dependencies' => 'ext.collection.bookcreator'
	),
	'ext.collection' => $collResourceTemplate + array(
		'scripts' => 'collection.js',
		'dependencies' => array( 'ext.collection.bookcreator', 'jquery.ui.sortable' ),
	),
	'ext.collection.bookcreator' => $collResourceTemplate + array(
		'scripts' => 'bookcreator.js',
		'styles' => 'bookcreator.css',
		'dependencies' => 'ext.collection.jquery.jstorage'
	),
	'ext.collection.checkLoadFromLocalStorage' => $collResourceTemplate + array(
		'scripts' => 'check_load_from_localstorage.js',
		'dependencies' => 'ext.collection.jquery.jstorage'
	)
);
What's wrong with the code?

Re: Fatal Error! D:

Posted: Fri Jan 21, 2011 11:40 pm
by McInfo
For that statement to work, both $wgResourceModules and $collResourceTemplate must hold arrays. If either variable holds an integer, NULL, or any other data type, the statement will fail.