Download & Extend

Exposed Proximity Search Filter not recognized

Project:Location
Version:5.x-3.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)
Issue tags:gmap, Location proximity view

Issue Summary

I used the fix from http://drupal.org/node/321114, and that worked for me.

Changed line 934 in location_views.module to

if (is_array($filter['value']) && isset($filter['value']['latitude'])) {

from

if (isset($filter['value']['latitude'])) {

Comments

#1

Status:active» needs review

needless patch

AttachmentSize
location_views-326749-1.patch 562 bytes

#2

Status:needs review» reviewed & tested by the community

Worked for me

#3

this also worked for me. it also works for location 5.x.3

#4

This is still broken in the 5.x.3 release. Line 948

#5

Version:5.x-3.0-rc2» 5.x-3.x-dev
Status:reviewed & tested by the community» fixed

Oh, I get it now.

Yeah, I always forget that PHP will try to treat a string as an array.

Fixed.
http://drupal.org/cvs?commit=159249

#6

Status:fixed» closed (fixed)

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

#7

Just to add, this does not seem to work with the g-map module addition.
An example may be seen at postyourtest.com/tests

#8

Two remarks with the proximity using postal code / country:

1/ the arguments are reversed on line 217

    // Add MBR check (always.)
    $this->query->add_where($this->options['group'], "$this->table_alias.latitude > %f AND $this->table_alias.latitude < %f AND $this->table_alias.longitude > %f AND $this->table_alias.longitude < %f", $lonrange[0], $lonrange[1], $latrange[0], $latrange[1]);

2/ you need a function location_latlon_rough_xx inside supported/location.xx.inc, you should be fine copying the one from location.us.inc, for Belgium you'll get this (make sure to populate the zipcodes table):

function location_latlon_rough_be($location = array()) {
  if (!isset($location['postal_code'])) {
    return NULL;
  }

  $result = db_query("SELECT latitude, longitude FROM {zipcodes} WHERE country = '%s' AND zip = '%s'", $location['country'], $location['postal_code']);

  if ($row = db_fetch_object($result)) {
    return array('lat' => $row->latitude, 'lon' => $row->longitude);
  }
  else {
    return NULL;
  }
}

#9

Status:closed (fixed)» needs review
Issue tags:+Location proximity view

marked #327319: user proximity map filter doesn't work as a duplicate of this issue.

can someone evaluate the concerns raised in #8?

#10

Status:needs review» postponed (maintainer needs more info)

there have been a lot of changes in the newest official release, especially with regards to proximity search. Please try the newest release or dev and post back with a new detailed summary. If the problem still exists, please change the status to needs work (as it will need a reroll against the new version, http://drupal.org/patch/create). Thanks.

#11

Status:postponed (maintainer needs more info)» closed (fixed)

I believe this is fixed in the 6.x-3.x and 7.x-3.x versions.

nobody click here