Okay, this one frustrated me nearly all day. In a nutshell, Location CCK is saving its settings to the wrong table/field. Each instance of a Location widget is supposed to have its settings in content_node_field_instance.widget_settings; what is happening, though, is that any changes to the initial settings are being saved to content_node_field.global_settings. Obviously this creates some problems beyond default values, but that's where I noticed it.
Here's the scenario:
- Enable Location and Location CCK
- Go to Manage Fields for any content type and add a Location field
- Set the initial settings to Allow all fields, set the Province default to "CA" and leave the Country default at "United States"
- Create a new node -- the defaults are correctly filled in
- Go to Manage Fields and change the previous defaults to "BC" and "Canada," then confirm the defaults have been saved
- Create a a new node -- the defaults are the previous values
I'm guessing that fixing this issue will clean up a heck of a lot of other open issues. Just looking at these two database fields it seems that there's a lot of cruft in widget_settings that gets added to each time the settings are saved. Shouldn't these two fields be identical in the number of data points they contain?
Comments
Comment #1
yesct commentedComment #2
yesct commentedmight be related to #433470: Default Country location for CCK field stays on United States
Comment #3
yesct commentedmarked #392522: Allowed fields and default values as a duplicate.
Comment #4
infojunkieI am trying to set the default value programmatically via PHP. The field is not picking up the value, even though I am returning a value of the form
Is my case related to this issue?
Comment #5
yesct commentedmight be related/duplicates:
#45593: adding support for a default province/state?
If this is still a problem in the latest release, please do some testing and post back, setting the status back to active. Thanks.
Comment #6
ankur commentedNot sure if this is still an issue. Please re-open if this problem still occurs.