If you would like to write a module for this task, you could solve the problem as follows. I adapted this code from here.
Create a module directory in sites/all/themes/modules
and name it custom_exposed_year_filter
.
Create a file custom_exposed_year_filter.info
containing the following:
; custom_exposed_year_filter.info
name = Custom Exposed Year Filter
description = Sorts exposed years filter into a dropdown instead of a textfield
core = 7.x
files[] = custom_exposed_year_filter.module
Then, create a file named custom_exposed_year_filter.module
and insert this code:
<?php
// custom_exposed_year_filter.module
function custom_exposed_year_filter_form_views_exposed_form_alter(&$form, &$form_state) {
$field_id = 'field_reference_year_start';
// Only alter forms with the necessary field
if (isset($form[$field_id . '_value'])) {
// Build a query to get all node ids having the specified field
$query = new EntityFieldQuery();
$results = $query->entityCondition('entity_type', 'node')
->fieldCondition($field_id, 'value', 'NULL', '!=')
->fieldOrderBy($field_id, 'value', 'ASC')
->execute();
// Attach the field values to the nodes
$nodes = $results['node'];
field_attach_load('node', $nodes, FIELD_LOAD_CURRENT, array('field_id' => $field_id));
// Add a default so the filter is optional
$options = array('' => '<select>');
// Buld the options array based on the query results, overwriting duplicate entries
foreach ($nodes as $node) {
$value = $node->{"$field_id"}['und'][0]['value'];
$options[$value] = $value;
}
// Alter the field
$form[$field_id . '_value']['#type'] = 'select';
$form[$field_id . '_value']['#options'] = $options;
$form[$field_id . '_value']['#size'] = 1;
}
}
Lastly, adjust the following line so it matches the name of the field that you would like to filter for:
$field_id = 'field_your_field_name';
Then, clear the cache, enable your new module in Drupal, create a filter for your field, and check the 'exposed' box to make the filter available to visitors.
Should you need to turn multiple filters into dropdowns, you might adapt the code above or just create multiple modules for each field.
You might run into performance problems if you have a very large number of items in your view. It works like a charm for me, though.