I am trying to configure a view that is supposed to show my mapped nodes based on filter criteria set by the users. For example I need the user to be able to select a country and the view should display all nodes from that country. I am adding a filter on the "Location: Country" field and I am exposing it. The problem I am having is that the exposed filter is just a text field.
By trial and error I discovered that if I type Canada, the view will return nothing. But if I type CA, it will give me the nodes from Canada.

Obviously I cannot expect my users to use country codes ;-) So there must be a solution to this:
Either (1) configure the filter to somehow use the full country name or (2) have the filter to be exposed as a drop-down box (instead of plain text box).

Can you help me with that? Which of these are possible?

Comments

kirilius’s picture

Any ideas?

jasontanner’s picture

I don't believe what you want is possible at the moment. I think the location views integration is a work-in-progress.

Personally, I'd flag this behaviour as a bug.

kirilius’s picture

I would think that it is a bug too. Obviously the feature is there but no one would use country codes instead of names.

kirilius’s picture

Bumping this up. Is there any update on this issue?

bdragon’s picture

Assigned: Unassigned » bdragon

Working on it now.

bdragon’s picture

Category: support » feature
Status: Active » Fixed

OK, implemented.
Thanks for the request.
http://drupal.org/cvs?commit=153454

kirilius’s picture

Thanks, I will try!

kirilius’s picture

Ok, I found the updated files and applied them over my installation of Location.

When I try to create a filter on the Location: Country field, I get the following message:

warning: reset() [function.reset]: Passed variable is not an array or object in /home/hahaha/public_html/sites/all/modules/location/handlers/location_handler_filter_location_country.inc on line 83.
jasontanner’s picture

Any chance of modifying the theming so that the dropdown does not go outside the containing filter block div ?

Also, would this be an opportune time to include the possibility of a region selector (e.g. EUrope, Middle East, Africa, Americas etc ...)
And finally, being able to have a filter (autocomplete or dropdown) on the city selector that uses the selected country to select from the towns in the locations tables would be nice.

kirilius’s picture

Thanks, that did it!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.