Closed (duplicate)
Project:
Address Field
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Feb 2012 at 18:42 UTC
Updated:
25 Apr 2012 at 14:45 UTC
I needed address field in site so I used this module and wanted to set default values as most visitors will have some common values, like city and zip.
However, when I edited User profile, I found that when I changed some other field and saved (e.g. user name) upon saving, I had another address consisting only of city and zip which were there by default. So I have to:
Comments
Comment #1
hazah commentedSame here. I hacked the module, as it was unexceptable, but would love to see this fixed here. It makes no sense to force to undo the defaults just to ensure that another address is not created. Worse still, there is no method to get rid of an existing address other than makeing it "empty". There should be a button to do that.
Short term solution (provides a "- None -" option in the field's "Available Countries" setting & uses it instead of the site's default if the setting had been set in that list:
function _addressfield_country_options_list, change the initial assignment to$countriesto be$countries = array('' => '- None -') + country_get_list().function addressfield_default_values:$default_countryto be$default_country = ''.$available_countries variable.Comment #2
hazah commentedAny development on this?
Comment #3
les limThere's a patch in the queue for configuring which parts of the address must be entered in order for an address to be saved, which would resolve this issue:
#1263316: Configurable non-empty value conditions
Marking this as duplicate.