Results returned from cache are not sorted
bangpound - November 4, 2009 - 22:54
| Project: | GeoNames |
| Version: | 6.x-1.2 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Here's the code that's problematic:
$query = array(
'lat' => '28.500103',
'lng' => '-81.357992',
'radius' => 50,
'style' => 'full',
'maxrows' => 50,
);
$options = array(
'sortby' => 'population',
'sortorder' => 'desc',
);
$result = geonames_query('nearbyplace', $query, $options);The first time that query is run, the top result is "Orlando" because the results are sorted. However, when the query is run again and cached results are used instead of a new query to geonames, the first result is "Edgewood" which is the nearest place to the coordinates.

#1
I have added a testcase for this, and can confirm the issue.
#2
Fixed in 6.x-1.x-dev, along with a testcase. Thanks!
http://drupal.org/cvs?commit=284804
#3
Automatically closed -- issue fixed for 2 weeks with no activity.