The following SQL error is experienced when the proximity filter is used through a view relation:
#1054 - Unknown column 'field_data_field_geolocation.field_geolocation_lat' in 'where clause'

After some investigation, it seems that the view's query does not use the table alias generated in the relation's JOIN, but the table name itself in the where condition, resulting in an error after executing the query.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ndobromirov’s picture

Created a patch that solves the issue. It seems general enough to be committed, because nothing structural is changed.

Ayesh’s picture

Thanks for the patch!
Worked very well for me!

ndobromirov’s picture

Assigned: ndobromirov » Unassigned
Status: Needs review » Reviewed & tested by the community

The code was tested by the community.
Change the issue status to RTBC.

ndobromirov’s picture

Priority: Major » Critical

Bump up priority to critical as this generates a fatal error.

Brandonian’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the patch, @ndobromirov! Committed to 7.x-2.x

http://drupalcode.org/project/geofield.git/commit/f43898e

Status: Fixed » Closed (fixed)

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

stred’s picture

related to the issue #2221337: table name when using proximity contextual filter causes SQL error , for me it is the opposite that works.

on line 82: $table = $this->ensure_my_table() ? $this->table : $this->table_alias;

really do not understand why but if it can help someone else...

stred’s picture

Hi had rewrited the query that's why the patch did not work as expected... Forget about my previous post, works like a charm, thank you!