What if I don't want a default value for an address field?
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | addressfield_fix.patch | 4.87 KB | fago |
| #3 | addressfield_form_default.inc_.patch | 1.09 KB | perarnet |
What if I don't want a default value for an address field?
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | addressfield_fix.patch | 4.87 KB | fago |
| #3 | addressfield_form_default.inc_.patch | 1.09 KB | perarnet |
Comments
Comment #1
damien tournoud commentedYou have to have at least a default country. Is the whole field required?
Comment #2
joachim commentedYup. Probably because when the field is on a node it's required too.
FieldAPI bug perhaps?
FieldAPI should allow me to leave the whole default section of the settings form blank if I want no default.
Comment #3
perarnet commentedThe fields were set to required. Attached is a patch fix
Comment #4
fagohm, it should respect the instance settings for that. Attached fixes that by passing all hook_field_widget_form() parameters through:
Comment #5
fagoComment #6
rszrama commentedfago's patch is brilliant, and it fixes some lower-cased trues and a side issue I'd noticed in addressfield_edit_form()'s arguments, too.
Great job - committed, and it made me realize recent fixes I made to get the widget form working properly on checkout / entity forms alike broke the widget form in the freaking field settings. Working on a fix now. : )
Comment #7
rszrama commented(fwiw, fixed the issue I was having - also learned that an element's #array_parents is for finding its place in $form while #parents is for finding its values place in $form_state['values']. Very useful to know!)