r66875 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66874‎ | r66875 | r66876 >
Date:15:33, 25 May 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Small fix
Modified paths:
  • /trunk/extensions/SemanticMaps/GeoCoords/SM_GeoCoords.php (modified) (history)
  • /trunk/extensions/SemanticMaps/GeoCoords/SM_GeoCoordsValue.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMaps/GeoCoords/SM_GeoCoordsValue.php
@@ -47,7 +47,7 @@
4848
4949 // Only add the table when the SQL store is not a postgres database, and it has not been added by SMW itself.
5050 if ( $smgUseSpatialExtensions && !array_key_exists( 'c', $fieldTypes ) ) {
51 - $fieldTypes['c'] = 'Point';
 51+ $fieldTypes['c'] = 'Point NOT NULL';
5252 }
5353
5454 return true;
@@ -182,11 +182,8 @@
183183 $this->unstub();
184184
185185 if ( $smgUseSpatialExtensions ) {
186 - // TODO
187 - return array(
188 - // GeomFromText()
189 - str_replace( ',', '.', " POINT({$this->mCoordinateSet['lat']} {$this->mCoordinateSet['lon']}) " )
190 - );
 186+ $point = str_replace( ',', '.', " POINT({$this->mCoordinateSet['lat']} {$this->mCoordinateSet['lon']}) " );
 187+ return array( "GeomFromText( '$point' )" );
191188 }
192189 else {
193190 return array(
Index: trunk/extensions/SemanticMaps/GeoCoords/SM_GeoCoords.php
@@ -22,6 +22,7 @@
2323 // Hook for initializing the Geographical Coordinate type.
2424 $wgHooks['smwInitDatatypes'][] = 'SMGeoCoordsValue::initGeoCoordsType';
2525
 26+// Hook for initializing the field types needed by Geographical Coordinates.
2627 $wgHooks['SMWCustomSQLStoreFieldType'][] = 'SMGeoCoordsValue::initGeoCoordsFieldTypes';
2728
2829 // Hook for defining a table to store geographical coordinates in.

Status & tagging log