Looking at field_ui_field_settings_form(), we discover that hook_field_settings_form() only lets the module defining the field append additional settings to the field. External modules should be able to append additional settings to the defined fields.

Currently, if a contributed module (like Field Permissions) wants to add field settings, it is required to do a form_alter(). We should fix this by making it so that hook_field_settings_form() applies to all modules, not just the module that's defining the field.

Comments

RobLoach’s picture

Status: Active » Postponed
webankit’s picture

Title: Allow modules to define field settings via hook_field_settings_form() » Allow modules to use fields settings hook
Status: Postponed » Active

hook_field_settings_form() & hook_field_instance_settings_form can only be invoked by the modules defining field.
#1 will add a similar functionality for formatter settings hooks. These issues are related but are not duplicate.

RobLoach’s picture

Status: Active » Closed (duplicate)
andypost’s picture

Title: Allow modules to use fields settings hook » Allow modules to alter fields settings hook
Status: Closed (duplicate) » Active

i think field settings (and instance) are different things

mrweiner’s picture

Has there been any development on this? I'd definitely suggest this as an addition to D8 at least, if not also D7. I also agree that this should be considered as separate from, albeit related to, the linked issue.

I really need a way to alter a field's settings based on role, and a hook like this is the only way that I can find to accomplish this. Unless, of course, somebody else has an alternative. I'm sure I'm not the only person who's ended up on this page while searching for a way to alter a field's settings via a hook.

attiks’s picture

#945524: Field formatter settings hooks in core is committed to D8, so this can be done as well

John Pitcairn’s picture

+1 from me...

andypost’s picture

Status: Active » Fixed
Issue tags: +Entity Field API

Suppose this already done in #1735118: Convert Field API to CMI
We have hook_entity_OPERATION() to alter anything and form alters fo UI

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