Download & Extend

Results returned from cache are not sorted

Project:GeoNames
Version:6.x-1.2
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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.

Comments

#1

I have added a testcase for this, and can confirm the issue.

#2

Status:active» fixed

Fixed in 6.x-1.x-dev, along with a testcase. Thanks!

http://drupal.org/cvs?commit=284804

#3

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.