Closed (fixed)
Project:
Address Field
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Jun 2012 at 12:24 UTC
Updated:
29 Dec 2014 at 14:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
fagoupdated the patch to do more cleanup, i.e. also fixed some comments and remove some more unnecessary code
In my tests the addressfield continued to behave properly in ajax callbacks and field api add-more handling.
Comment #2
fagoI just ran into an issue where an addressfield got populated with wrong default values when an addressfield is part of an embedded field-collection and a new one gets added. This patch fixed the issue :)
Comment #3
kepford commentedJust discovered the same issue on one of my client's sites. My issue was with the Commerce order edit page. I have an addressfield on each line item. If you have multiple line items on an order the last addressfield saved will be used as the default for the other line items address fields. This patch appears to have fixed the issue for me.
Thank you for the patch fago!
Comment #4
colan#1285980: hook_form_alter() doesn't affect #default_values as expected
Comment #5
jody lynnI had a multiple field collection containing an addressfield and the addresses were picking up default values from the first one entered. The first patch here fixed it (the one in comment 1 would no longer apply). the patch in #1285980: hook_form_alter() doesn't affect #default_values as expected did not fix it.
Comment #6
jody lynnComment #7
dgtlmoon commentedComment #8
swentel commentedThis doesn't seem todo the trick. For instance, add 'Canada' as a country. If you switch from say Belgium to Canada, the province field for canada doesn't show up at all.
Comment #9
bojanz commentedRetitling.
The patch is incomplete, $address still needs to be populated from form state because the handlers will need the updated values in order to rebuild the country-specific fields properly.
However, there's no reason why we can't take the new $address from $form_state directly, instead of duplicating the values in $form_state['addressfield'].
The field_collection issues are caused by the element_key being less granular than #parents.
Comment #10
bojanz commentedCompleted the patch, tested it, committed: http://cgit.drupalcode.org/addressfield/commit/?id=300c30e