Custom CCK Currency exposed filter for available currencies I am trying to set the available currencies programatically like this:

function mymodule_form_alter(&amp;$form, $form_state, $form_id) {
    /** Modify exposed filter views */
    if ($form_id == 'views_exposed_form') {
        $form['field_1hour_currency']['#type'] = 'select';
        $form['field_1hour_currency']['#options'] = array('EUR','USD');
    }
}


But I get An illegal choice has been detected. Please contact the site administrator. error in the view.

How can I set a select list of available currencies in the views exposed filter for a CCK currency field?

Thank you

(using D6, Views 2 and latest CCK Currency)
function mymodule_form_alter(&amp;$form, $form_state, $form_id) {
  if ($form_id == 'views_exposed_form' &amp;&amp; $form_state['view']-&gt;name == 'myview') {
    // Add our custom All buttons.
    $form['field_1hour_currency']['#type'] = 'select';
    $form['field_1hour_currency']['#options'] = array(
      '' =&gt; t('&lt;Any&gt;'),
      'USD' =&gt; 'USD',
      'EUR' =&gt; 'Euro'
    );
  }
}


The key is to ensure you include the empty option:

'' =&gt; t("&lt;Any&gt;")


See http://drupal.org/node/463990

You may want to post this solution on your issue on drupal.org too if it works for you: http://drupal.org/node/1155934 ;)