Fatal error: Unsupported operand types
Fragment of a discussion from Help talk:Semantic mapping
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.
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'];
