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.

Comments

merlinofchaos’s picture

Status: Active » Needs review
StatusFileSize
new1.56 KB

This 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.

damien tournoud’s picture

Status: Needs review » Fixed

Thanks for the patch! Makes total sense. Merged into 7.x-1.x.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.