Help talk:Semantic mapping

From Mapping on MediaWiki
Jump to: navigation, search

Contents

Thread titleRepliesLast modified
Fatal error: Unsupported operand types509:39, March 5, 2012
Bigger pages for readability010:12, January 31, 2012

Fatal error: Unsupported operand types

The links "Aggregate coordinates with queries" and "Display aggregated coordinates on maps" (http://mapping.referata.com/wiki/Help:Queries) on this page gives:

Fatal error: Unsupported operand types in /home/yaron57/public_html/w/includes/parser/LinkHolderArray.php on line 33
Mike11:53, April 5, 2011

I also have this error, each time I try to use something like: {{#ask: [[has coordinates::+]] | ?has coordinates | format=map }} I'm sure the 'has coordinates' has a correct content, and the property type is 'Geographic coordinate' (tried also other types like string, giving the same error).

It says "Unsupported operand types" for file LinkHolderArray.php, line 41:

$this->interwikis += $other->interwikis;

I don't use anything related to interwikis (well not that I know), so that's a bit strange. I commented the line, and it worked.

(I'm using Mediawiki 1.17, SemanticMaps and Semantic MediaWiki rev.91632)

lstep12:38, July 18, 2011
 

I have the same error. It's probably the bug that is related to the version of PHP, better to tell Jeroen about it.

95.182.71.12014:20, July 18, 2011
 

I have also encountered this error on a server with php 5.2.6. It does not occur with php 5.3.3. It is the variable 'interwikis' in LinkHolderArray that is NULL. But by grepping for references to this variable, i cannot find any assignments made to it outside of LinkHolderArray, where it is properly initated to an array. So, probably a php bug. A workaround:

       if ( !$this->interwikis ) {
          $this->interwikis = $other->interwikis;
       } else {
          $this->interwikis += $other->interwikis;
       }
Andreas Jonsson08:48, October 3, 2011
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
 
 
 

Bigger pages for readability

Hi! I think that the documentation will be more readable if instead of dozen small pages (less than one screen) all information concentrates in several big wiki-articles. Can I move the following page texts here?

  1. Semantically annotate coordinates.
  2. Aggregate coordinates with queries.
  3. Display aggregated coordinates on maps.
Ganqqwerty10:12, January 31, 2012