Cannot Select Particular Countries for Views Location Filter
| Project: | Location |
| Version: | 6.x-3.1-rc1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
We have a view built that displays nodes from three countries (U.S.A, Mexico, Canada). We have used the location module to input our location data and are using the Gmap module to display the nodes via Google maps. When building the filters (which we exposed) for our views display we noticed that the Location: Country filter does not respect 'Is' or 'Is Not' operator. Instead of just showing USA, Mexico and Canada (the three countries we selected when configuring the filter )the dropdown select list in the exposed filter still displays all the countries. I am pretty sure this is a bug in the location_handler_filter_location_country.inc file, but I do not know where to begin to fix this issue. Any help or suggestions would be greatly appreciated.

#1
Same issue. Would like a resolution myself.
Other views fields (content textfield) have an option for "filter to selected items" when you expose a view. Location should include this as well.
#2
Here's my patch, which takes some code from the views_handler_filter_in_operator which provides the "Limit list to selected items" functionality and copying some code from that codebase as well.
I'm not sure if this will cause any other problems, so I'd recommend someone who knows views more than me review the code before it's committed into the codebase.
#3
Hi,
i'm getting the same issue. i tried the patch, but it did not seem to work for me. i have selected a subset of the listed countries, yet all of them show in the dropdown.
thanks,
m
#4
I applied this patch again to my location module and it worked again. I'm not sure what your issue is. Does the patch not apply for you?
cd sites/all/modulespatch -p0 < location_views_exposed_filter_country_filter.diff
You'll of course need to select the countries you want to show up in your exposed views filter. For me, this patch works. I'm using the latest Views and Location modules to date.
#5
Attached patch fixes it for me.
#6
i applied the latest patch, by hand, and it worked fine. thank you very much!!!
will this be rolled into a release?
much appreciated. this is huge for us!
thanks again.
m