I tried this on a completely fresh install of the latest Drupal 7.17 and Addressfield 7.x-1.0-beta3.
- Enable addressfield.
- Add an address field instance to the user entity. Require its inclusion on the user registration form and require the user supply their address.
- Enable drupal page cache and set the minimum cache lifetime to something like an hour.
- Clear your page cache
- Visit the user registration page at /user/register. This should be a cache miss.
- Address field should default to the US. Select any US state (like "Washington").
- Change the country to Brazil.
- Navigate to the user registration page again. This should be a Drupal cache hit.
- Address field should default to the US. Select any US state again (like "Washington").
- Change the country to Italy.
You should now see something like the following image where an "illegal choice has been detected" message is shown and the form shown represents the Brazilian address field variation (with Brazilian states), even though Italy is selected as the country.
The net result is that when page caching is enabled, users are able to negatively affect the user experience for independent and completely unrelated users who subsequently attempt to submit the form.
This is especially aggravated if you're automatically selecting state/country values on the frontend.
Seems like addressfield shouldn't cache form and form state values when a user selects a different country.
|Screen shot 2012-12-07 at 4.45.07 PM.png||47.2 KB|