Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_JSONlink.php |
— | — | @@ -58,12 +58,14 @@ |
59 | 59 | while ( ( /* array of SMWResultArray */ $row = $res->getNext() ) !== false ) { |
60 | 60 | $rowsubject = false; // the wiki page value that this row is about |
61 | 61 | $valuestack = array(); // contains Property-Value pairs to characterize an Item |
| 62 | + $addedLabel = false; |
62 | 63 | |
63 | 64 | foreach ( $row as /* SMWResultArray */ $field ) { |
64 | 65 | $pr = $field->getPrintRequest(); |
65 | 66 | |
66 | | - if ( $rowsubject === false ) { |
| 67 | + if ( $rowsubject === false && !$addedLabel ) { |
67 | 68 | $valuestack[] = '"label": "' . $field->getResultSubject()->getTitle()->getFullText() . '"'; |
| 69 | + $addedLabel = true; |
68 | 70 | } |
69 | 71 | |
70 | 72 | if ( $pr->getMode() != SMWPrintRequest::PRINT_THIS ) { |
— | — | @@ -74,7 +76,7 @@ |
75 | 77 | $finalvalues = ''; |
76 | 78 | switch ( $dataValue->getTypeID() ) { |
77 | 79 | case '_geo': |
78 | | - $values[] = '"' . $dataValue->getWikiValue() . '"'; |
| 80 | + $values[] = FormatJson::encode( $dataValue->getDataItem()->getCoordinateSet() ); |
79 | 81 | break; |
80 | 82 | case '_num': |
81 | 83 | $values[] = $dataValue->getDataItem()->getNumber(); |