Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The example implementations of the hook_field_formatter_settings_* hooks (in field_ui.api.php) include conditions which check the field type.
I think it would be more appropriate if these examples used a check for the formatter type. The reasons for this are:
- The additional settings apply specifically to field formatters (not fields as such), but
- A field type can have more than one type of formatter, and
- Some field formatters can be used for more than one type of field.
Comment | File | Size | Author |
---|---|---|---|
#2 | improve-field_ui-documentation-2029581-2.patch | 1.38 KB | andrewmacpherson |
#1 | improve-field_ui-documentation-2029581-1.patch | 1.38 KB | andrewmacpherson |
Comments
Comment #1
andrewmacpherson CreditAttribution: andrewmacpherson commentedComment #2
andrewmacpherson CreditAttribution: andrewmacpherson commentedMinor correction to the previous patch; method call brackets were missing.
This one uses correct getPluginId()
Comment #3
swentel CreditAttribution: swentel commentedGood!
Comment #4
jhodgdonThanks for the patch and review! Definitely a better example. Committed to 8.x.
If you think we should port this to 7.x, please set the issue version/status appropriately and do so. Thanks!