Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Column not found distance #29

Closed
webvader opened this issue Mar 7, 2015 · 3 comments
Closed

Column not found distance #29

webvader opened this issue Mar 7, 2015 · 3 comments

Comments

@webvader
Copy link

webvader commented Mar 7, 2015

Hi,

When i try to use the search on proximity I get an SQL error Column not found distance whatever i put in for the order e.g. MyFieldHandle_distance I still get Column not found ... Any idea how to fix this?

This is the code I use:

{% set query = craft.request.getParam('q') %}
{% if query is defined %}
{% set searchParams = { 'address': query, distance: 200 } %}
{% set foundLocations = craft.entries.section('locations').map(searchParams).order('googleMapField_distance asc') %}
{% else %}
{% set foundLocations = locations %}
{% endif %}

@webvader
Copy link
Author

webvader commented Mar 7, 2015

Re-installed the plugin and re-saved the entries. now the SQL error is gone and search is working, but marker.distance is empty.

Nevermind got it working: I used location.map.markers instead of location.map.markers() ... both work except the latter returns distance, the first one does not.

@mdxprograms
Copy link

@objectivehtml is there any fixes in the works for this issue? I noticed there's a couple more open with the same issue.

@objectivehtml
Copy link
Owner

#48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants