Jeroen De Dauw has uploaded a new change for review.
https://gerrit.wikimedia.org/r/51844
Change subject: Fix issue caused by change in field order, bug 44933
......................................................................
Fix issue caused by change in field order, bug 44933
Change-Id: I6617e80314ac4b6b72221220fa153214d682bee4
---
M includes/SM_AreaValueDescription.php
M includes/SM_GeoCoordsValueDescription.php
2 files changed, 12 insertions(+), 8 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticMaps
refs/changes/44/51844/1
diff --git a/includes/SM_AreaValueDescription.php
b/includes/SM_AreaValueDescription.php
index 8cbe4ba..24e338f 100644
--- a/includes/SM_AreaValueDescription.php
+++ b/includes/SM_AreaValueDescription.php
@@ -109,7 +109,9 @@
/**
* @see SMWDescription::getSQLCondition
- *
+ *
+ * FIXME: store specific code should be in the store component
+ *
* @since 0.6
*
* @param string $tableName
@@ -140,10 +142,10 @@
$biggerThen = $isEq ? '>' : '<=';
$joinCond = $isEq ? 'AND' : 'OR';
- $conditions[] = "{$tableName}.$fieldNames[0] $smallerThen $north";
- $conditions[] = "{$tableName}.$fieldNames[0] $biggerThen $south";
- $conditions[] = "{$tableName}.$fieldNames[1] $smallerThen $east";
- $conditions[] = "{$tableName}.$fieldNames[1] $biggerThen $west";
+ $conditions[] = "{$tableName}.$fieldNames[1] $smallerThen $north";
+ $conditions[] = "{$tableName}.$fieldNames[1] $biggerThen $south";
+ $conditions[] = "{$tableName}.$fieldNames[2] $smallerThen $east";
+ $conditions[] = "{$tableName}.$fieldNames[2] $biggerThen $west";
$sql = implode( " $joinCond ", $conditions );
diff --git a/includes/SM_GeoCoordsValueDescription.php
b/includes/SM_GeoCoordsValueDescription.php
index 75fa558..89aa04d 100644
--- a/includes/SM_GeoCoordsValueDescription.php
+++ b/includes/SM_GeoCoordsValueDescription.php
@@ -28,7 +28,9 @@
/**
* @see SMWDescription::getSQLCondition
- *
+ *
+ * FIXME: store specific code should be in the store component
+ *
* @since 0.6
*
* @param string $tableName
@@ -56,8 +58,8 @@
$conditions = array();
- $conditions[] = "{$tableName}.$fieldNames[0]
$comparator $lat";
- $conditions[] = "{$tableName}.$fieldNames[1]
$comparator $lon";
+ $conditions[] = "{$tableName}.$fieldNames[1]
$comparator $lat";
+ $conditions[] = "{$tableName}.$fieldNames[2]
$comparator $lon";
return implode( ' && ', $conditions );
}
--
To view, visit https://gerrit.wikimedia.org/r/51844
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6617e80314ac4b6b72221220fa153214d682bee4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticMaps
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits