When viewing CiviCRM contacts in a Drupal view, you can filter on the Address:Country , but the filter widget proposes you to filter on one or more of the 300+ countries in CiviCRM.
When exposing this filter, the user sees those 300+ countries. If only ~50 countries actually have contacts, such a dropdown is not very useful. Most countries will return 0 results.
It would be good enough if I can have a text search on the name of the country, but I can't get that to work. The filter only supplies the country id (eg using a 'combine' filter on the single field requires you to enter a number as a search string - that works).
Is there any way to pull the country table into the view and, for example, rewrite the view using
hooks_views_query_alter to allow you to filter on the country name ?
Or any other solution someone found, like limiting the dropdown to used countries only ?