I'm using addressfield on the user profile page without any problems, great module!!!
On the registration I'm requiring the country to be selected, city, state and zip are optional.

When I looked into the $form_state array to get to the country value I found this array:

Array
(
    [user|user|field_address|und|0] => Array
        (
            [thoroughfare] => 
            [premise] => 
            [locality] => my city
            [administrative_area] => CA
            [postal_code] => 99999
            [country] => US
        )

)

[user|user|field_address|und|0] doesn't look right to me. Is this a bug?

Thanks

UWE

Comments

rszrama’s picture

Status: Active » Closed (works as designed)

Nope, this is correct. What you're seeing is the element_key we use to identify an addressfield element on a form. This ensures it works for some entity reference situations across AJAX refreshes and what not. You'd see the actual input broken out in the $form_state['values'] array like you'd expect.