-
Notifications
You must be signed in to change notification settings - Fork 19
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
CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'distance' in 'order clause'. #47
Comments
Damnit! "Note, when you want to sort by the proximity you must use the following format yourMapField_distance. When the query is built, the field name is prepended to the distance column." Too late a night writing code. Nvm me. |
Well, "Column not found: 1054 Unknown column 'googleMapField_distance' in 'order clause". What am I doing wrong then? I prepended and no dice... {% set entries = craft.entries.section('storeLocations').level(2).map(params).order('googleMapField_distance asc') %} googleMapField is the handle for the Google Map I added to the Store Location fields which go in the Store Locations section. I'm stumped. Its late. |
I'm getting the same error - any updates here?
Also doesn't work if I append my googleMap field to distance :: |
I have found a fix for distance. Hopefully this helps someone down the road. I originally used zip codes in comparison and was unable to get distance to work. Even after attempting to use street addresses and cities I was still unsuccessful. However, when I used lat/lng for both addresses it worked like a charm. |
Sorry for the lack of replies guy. Was off work most of last year due to some serious health and personal issues. I'll try to address the problems here in case people are still wondering or having issues. First off, I changed some code in the last major release and didn't update the wiki so that's likely causing confusing. Now, Here is another thread where I posted some additional remarks and possible fixes. Im going to close this thread, but if anyone else has any questions related to this issue please feel free to post them here. |
Hello,
I think this is something to do with how I've set this up, but I have the latest version from master (0.8.2 as best I can tell?) and am getting this error.
CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'distance' in 'order clause'.
I'm trying to use the search by proximity feature: https://github.com/objectivehtml/Google-Maps-for-Craft/wiki/Search-by-Proximity
This is my lookup and the rest of the code looks the same.
{% set entries = craft.entries.section('storeLocations').level(2).map(params).order('map_distance asc') %}
{% set entries = craft.entries.section('storeLocations').level(2).map(params).order('distance asc') %}
{% set entries = craft.entries.section('storeLocations').map(params).order('map_distance asc') %}
{% set entries = craft.entries.section('storeLocations').map(params).order('distance asc') %}
I've read all through the docs, but maybe missed something. This commit seems to indicate there should be a distance field or ability to set that, but I'm confused what that means and if its some sort of setup process I missed? 77a5ff8 ?
Thanks for any help at all. I'm stumped!
The text was updated successfully, but these errors were encountered: