Fatal error: Unsupported operand types

Jump to: navigation, search
Edited by 0 users.
Last edit: 09:40, October 3, 2011

I have now also encontered this error in php 5.3.3, so it is not dependent of php version. Also the variable 'internals' suddenly becomes NULL.

Andreas Jonsson09:40, October 3, 2011

I have found the root cause of this problem. It is the fact that the parser is cloned. So, this patch fixes the problem:

=== modified file 'extensions/Maps/includes/features/Maps_BasePointMap.php'
--- extensions/Maps/includes/features/Maps_BasePointMap.php	2011-09-26 09:16:31 +0000
+++ extensions/Maps/includes/features/Maps_BasePointMap.php	2012-02-26 22:58:44 +0000
@@ -130,16 +130,18 @@
 	 * @param Parser $parser
 	 */
 	protected function handleMarkerData( array &$params, Parser $parser ) {
-		$parserClone = clone $parser;
+		$p = new Parser();
 		$iconUrl = MapsMapper::getFileUrl( $params['icon'] );
 		$params['locations'] = array();
+		$opts = new ParserOptions();
+		$title = $parser->getTitle();
 
 		foreach ( $params['coordinates'] as $location ) {
 			if ( $location->isValid() ) {
 				$jsonObj = $location->getJSONObject( $params['title'], $params['label'], $iconUrl );
 				
-				$jsonObj['title'] = $parserClone->parse( $jsonObj['title'], $parserClone->getTitle(), new ParserOptions() )->getText();
-				$jsonObj['text'] = $parserClone->parse( $jsonObj['text'], $parserClone->getTitle(), new ParserOptions() )->getText();
+				$jsonObj['title'] = $p->parse( $jsonObj['title'], $title, $opts )->getText();
+				$jsonObj['text'] = $p->parse( $jsonObj['text'], $title, $opts )->getText();
 				
 				$hasTitleAndtext = $jsonObj['title'] != '' && $jsonObj['text'] != '';
 				$jsonObj['text'] = ( $hasTitleAndtext ? '<b>' . $jsonObj['title'] . '</b><hr />' : $jsonObj['title'] ) . $jsonObj['text'];

Andreas Jonsson09:39, March 5, 2012
 
Personal tools
Variants
Views
Actions
Navigation
Manuals
Useful lists
More awesomeness
Toolbox