Skip to content

Commit bcd7da7

Browse files
committedDec 12, 2015
Merge pull request #33 from joaoinacio/EZP-25246_gmap_float_locale
Fix EZP-25246 MapLocation issues with alternate locale
2 parents a381e61 + fd43c70 commit bcd7da7

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed
 

‎lib/FieldValueMapper/GeoLocationMapper.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ public function map(Field $field)
4444
return null;
4545
}
4646

47-
return $field->value['latitude'] . ',' . $field->value['longitude'];
47+
return sprintf('%F,%F', $field->value['latitude'], $field->value['longitude']);
4848
}
4949
}

‎lib/Query/Content/CriterionVisitor/MapLocation/MapLocationDistanceIn.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function visit(Criterion $criterion, CriterionVisitor $subVisitor = null)
6969
$queries = array();
7070
foreach ($criterion->value as $value) {
7171
foreach ($fieldNames as $name) {
72-
$queries[] = "geodist({$name},{$location->latitude},{$location->longitude}):{$value}";
72+
$queries[] = sprintf('geodist(%s,%F,%F):%s', $name, $location->latitude, $location->longitude, $value);
7373
}
7474
}
7575

‎lib/Query/Content/CriterionVisitor/MapLocation/MapLocationDistanceRange.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ public function visit(Criterion $criterion, CriterionVisitor $subVisitor = null)
8282
$queries = array();
8383
foreach ($fieldNames as $name) {
8484
// @todo in future it should become possible to specify ranges directly on the filter (donut shape)
85-
$query = "{!geofilt sfield={$name} pt={$location->latitude},{$location->longitude} d={$end}}";
85+
$query = sprintf('{!geofilt sfield=%s pt=%F,%F d=%s}', $name, $location->latitude, $location->longitude, $end);
8686
if ($start !== null) {
87-
$query = "{!frange l={$start}}{$query}";
87+
$query = sprintf("{!frange l=%F}{$query}", $start);
8888
}
8989

9090
$queries[] = "{$query} AND {$name}_0_coordinate:[* TO *]";

0 commit comments

Comments
 (0)
Please sign in to comment.