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.
Comment | File | Size | Author |
---|---|---|---|
#5 | location_handler_filter_location_country-467412-5.patch | 3.13 KB | q0rban |
#2 | location_views_exposed_filter_country_filter.diff | 1.9 KB | j0rd |
Comments
Comment #1
j0rd CreditAttribution: j0rd commentedSame 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.
Comment #2
j0rd CreditAttribution: j0rd commentedHere'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.
Comment #3
marqpdx CreditAttribution: marqpdx commentedHi,
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
Comment #4
j0rd CreditAttribution: j0rd commentedI 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?
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.
Comment #5
q0rban CreditAttribution: q0rban commentedAttached patch fixes it for me.
Comment #6
marqpdx CreditAttribution: marqpdx commentedi 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
Comment #7
alisonJust came over from a duplicate issue I created (#759748: Filter by Country, exposed, limit list to selected), not finding this one first...
Anyway, I just wanted to give a "me too!!" to supporting getting this feature into a release at some point. Thank you!
Comment #8
YesCT CreditAttribution: YesCT commentedtagging.
Comment #9
YesCT CreditAttribution: YesCT commentedalisonjo2786, I saw your "me too", one of the best me too's to get anything into location is to do a review *grin*
http://drupal.org/patch/review
Please contact me if you want help doing a review.
Comment #10
clashar CreditAttribution: clashar commentedsubscribe
Comment #11
Sinovchi CreditAttribution: Sinovchi commentedI applied patch from #5 and it works very well! Thank you for this module and patch! Will this patch be included into the locations module?
Comment #12
vosechu CreditAttribution: vosechu commentedpatch from #5 works great for me as well. Setting to rtbc.
Comment #13
Fabianx CreditAttribution: Fabianx commentedsubscribe, from looking at the code it seems fine.
Comment #14
rooby CreditAttribution: rooby commentedChanging version as problem still in current version.
Thanks for the patch, works as expected.
Committed patch in #5 to 6.x-3.x and HEAD.
http://drupal.org/cvs?commit=473680
http://drupal.org/cvs?commit=473682
Comment #15
rooby CreditAttribution: rooby commentedMarked #749722: Problem with Country as exposed filter in Views, ignoring default and causing no rows to return as duplicate of this issue.
Comment #17
awasson CreditAttribution: awasson commentedSubscribing