Most core implementations of hook_field_formatter_settings_form() are wrong :
They build and return a form sub array, which they happily name $form.
However, they also receive the whole surrounding form as a $form param.
--> The returned $form is the whole surrounding form + the subform additions, instead of only the subform.
Does not make any real difference when the settings form is displayed on Field UI's current "Manage display" screen because of the way the code is structured : form arrays for the rows are built in a $table variable, which is then assigned into $form - $form is thus still mainly empty when hook_field_formatter_settings_form() is called.
That's not the case when the 'formatter settings' are embedded in a Views 'configure field' form (being added at #884730: Add new UI for formatter settings options to the field settings panel)
Oddly enough, the sample code for hook_field_formatter_settings_form() in field.api.php was correct...
| Comment | File | Size | Author |
|---|---|---|---|
| hook_field_formatter_settings_form.patch | 3.4 KB | yched |
Comments
Comment #1
moshe weitzman commentedComment #2
dries commentedCommitted to CVS HEAD. Thanks.