Address Field implements hook_field_formatter_settings_form but it does so incorrectly.
$form is sent as input to the hook, but the pre-existing form should not be returned. The hook example uses $element, rather than $form, for adding new items to the form.
In the normal Field UI, this bug has no effect, because at the time the settings are invoked, there are no visible elements on the form. However, in Views, the entire options form is there. Because of this, the address field options form ends up completely duplicated, which is extremely confusing.
Patch forthcoming.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 1266994-fix-addressfield-settings-form.patch | 1.56 KB | merlinofchaos |
Comments
Comment #1
merlinofchaos commentedThis simple patch just swaps the use of $form for $element which is in line with the example provided in the hook documentation.
To test this patch, make sure you have an address field configured. Then go to Views and try to add it as a field in the UI. You'll see the form duplicated. Apply the patch and check again; the form will show up correctly.
Comment #2
damien tournoud commentedThanks for the patch! Makes total sense. Merged into 7.x-1.x.