Addresses Module - Province (State) Used to Be a Drop-Down I am having trouble with the addresses module (version 6.x-1.12) running on my Drupal 6.28 site. Recently the addresses module stopped showing a drop-down menu for the Province (State) field on my custom content type. I am not certain when this happened, or what caused this change. I did some major upgrades to the site, tested everything, and thought this was working after the upgrade.


This above image shows what I'm talking about. This is from my profile, in case anyone cares about the confidential data I am showing the world.


The above image shows the configuration options for the addresses module I have installed. I don't see any options to make it so that the province is a drop-down, despite the fact that the module info page says it has all the provinces for all the countries it supports...?


The above image shows the address field configuration options for my custom content type using the address field. It's called a uprofile or user profile, and stores additional information about the user. 

Thank you very much for taking the time to look at my question. I tried to be as complete as possible. If you want to try to create an account to see what I am talking about (or to be an extra in a movie filmed in New Mexico!) the site is here.
A quick look suggests that you put in a patch to the module that didn't get re-rolled into the module after your update as when I installed the module on a testbed it didn't work until I did :)

Anyways, if you look at https://drupal.org/node/244471 and scroll on down to comment #63 you'll see the patch.

If you want to just edit up the code directly, you want to change

  // Invoke addressfieldapi to allow modules to add their own addresses fields.
  // Then update these fields with the global settings for each field instance.
  $extra = module_invoke_all('addressesfieldapi', 'form', $fields, $values);
  foreach (element_children($extra) as $ename) {
    if (isset($settings[$ename . '_label'])) {
      $extra[$ename]['#title'] = t($settings[$ename . '_label']);
    }
    if (isset($settings[$ename . '_desc'])) {
      $extra[$ename]['#description'] = t($settings[$ename . '_desc']);
    }
    if ('textfield' == $extra[$ename]['#type'] &amp;&amp; isset($settings[$ename . '_size'])) {
      $extra[$ename]['#size'] = $settings[$ename . '_size'];
      // $extra[$ename]['#attributes'] = array('class' =&gt; 'text');  // REMOVE OR COMMENT THIS LINE OUT

      // ADD THE FOLLOWING:

      if (isset($extra[$ename]['#attributes']['class'])) {
        $extra[$ename]['#attributes']['class'] .= ' text';
      }
      else {
        $extra[$ename]['#attributes'] = array('class' =&gt; 'text');
      }

      // THIS IS THE END OF THE NEW CODE

    }
  }


around line 253 in addresses.module.  That made it work for me anyway.

Oh, if you are interested, the reason it didn't work is AJAX couldn't find the class of the province field, as further on up the chain it was being added, but then overwritten here.