When I configured Geofield as exposed filter (with Grouped settings) to display nodes by distance from a Person, every time I was submitting exposed form with the value changed for Distance filter, I wouldn't get any results back.
So I started debugging to see where it fails, and I saw that the query condition being created is something like this for request DISTANCE <= 5 miles:
(( 3959 * ACOS( COS( RADIANS(26.629724) ) * COS( RADIANS(field_data_field_geo.field_geo_lat) ) * COS( RADIANS(field_data_field_geo.field_geo_lon) - RADIANS(-80.053181) ) + SIN( RADIANS(26.629724) ) * SIN( RADIANS(field_data_field_geo.field_geo_lat) ) ) ) = 5) ))
Basically, the query was built, but the Operator value for condition wasn't taken into account.
Comment | File | Size | Author |
---|---|---|---|
#2 | geofield-distance-proximity-filter-grouped-operator-2811931-2.patch | 795 bytes | veronicaSeveryn |
Screen Shot 2016-10-05 at 2.31.40 PM.png | 267.62 KB | veronicaSeveryn |
Comments
Comment #2
veronicaSeveryn CreditAttribution: veronicaSeveryn commentedBased on the Views views_handler_filter implementation, I figured that the Geofield handler is missing this piece of code where it checks for Grouped Filter operator settings:
So, I created a patch for Review.
Comment #3
jason@blaze CreditAttribution: jason@blaze commentedI ran into this problem today, and the patch seems to have resolved the issue.
+1