Cannot Select Particular Countries for Views Location Filter

aelling - May 19, 2009 - 21:09
Project:Location
Version:6.x-3.1-rc1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

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

j0rd - September 2, 2009 - 03:48

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

j0rd - September 2, 2009 - 06:39
Version:6.x-3.x-dev» 6.x-3.1-rc1
Status:active» needs review

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.

AttachmentSize
location_views_exposed_filter_country_filter.diff 1.9 KB

#3

marqpdx - September 29, 2009 - 17:37

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

j0rd - October 9, 2009 - 02:36

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/modules
patch -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

q0rban - October 28, 2009 - 20:18

Attached patch fixes it for me.

AttachmentSize
location_handler_filter_location_country-467412-5.patch 3.13 KB

#6

marqpdx - October 30, 2009 - 00:02

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

 
 

Drupal is a registered trademark of Dries Buytaert.