Addresses field settings are always reset to default values
zedzed - March 25, 2009 - 08:19
| Project: | Addresses |
| Version: | 6.x-1.x-dev |
| Component: | User interface |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | reviewed & tested by the community |
Description
In addresses settings page, a settings form that will allow admins to choose which addresses fields should be used don't work perfectly. If i choose "none" for some field and save it, when page is reloaded, this fields printed with default module value.
Code used to set default value (function _addresses_settings_fields):
'#default_value' => empty($field_values[$ftype]) ? $field['display'] : $field_values[$ftype],don't work because when value is "none", $field_values[$ftype] is 0, function empty() return true ...
This code should be work :
'#default_value' => !isset($field_values[$ftype]) ? $field['display'] : $field_values[$ftype],ps: i hope you understand my bad english ...

#1
I have noticed the same issue, and this fix seems to work just fine. Thanks!
fyi: the problem is in /addresses/addresses.settings.inc line 305.
#2
I can confirm that the change presented above fixes the bug. Here's a patch.
#3
Patch works well for initial page load, but upon refreshing the page in Firefox 3.5 the value of all radio button settings is shifted to the next (eg., Primary Address Checkbox changes from 'None' to 'Normal', then 'Required' on second refresh). Only occurs on a refresh, not a direct request to the url from the address bar.
I'm unable to test this behaviour in IE 8 right now.
Is this a separate issue? or caused outside of Addresses module?
#4
@gapple, This could be a bug with Firefox's autocomplete feature, see http://www.ryancramer.com/journal/entries/radio_buttons_firefox/.