To reproduce issue:
select only one available country (in my case United States) and don't select Hide the country when only one is available from the format handlers.

The issue:
when you got to actually fill in values for that field, you won't be able to see the administrative area/postal_code text boxes. This is because these boxes are loaded on the event of change of the country textbox.

I'm able to get around this issue by using the format handler Hide the country when only one is available. Also any other people who come upon this who for some reason need to have this country dropdown and are looking for a workaround you can just write a bit of javascript to trigger the change event on the textbox.

Like so:
$("#addressfield-wrapper select.country").trigger('change');

Comments

rszrama’s picture

Status:Active» Fixed

The issue here is that the default value for your address field was at one time set to use some other country. Then you changed the address field settings to restrict it to just the U.S., but the country was still saved as something no longer available (that did not require a state / postal code).

In addressfield_default_values(), we check to ensure the default country used is one of a list of available countries. However, since we only do a simple union to merge these values with the $address array used to build the actual widget form, it wasn't overriding the previous (but now disabled) country with the actual default country. I've patched the widget form builder to make that check and revert to the default country if necessary.

Commit: http://drupalcode.org/project/addressfield.git/commitdiff/6632e54

Status:Fixed» Closed (fixed)

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