There are a number of field and instance settings that can not be altered globally via hook_field_widget_properties_alter(). So this request is to enable contrib to alter values in the field and instance after field_attach_form() and before MODULE_field_widget_form().
The two use-cases that I am interested are in:
a) Alter the field cardinality from MAX to 1 to something less than or equal to MAX
b) Toggle the required flag [without knowledge of each and every widget that could potentially set it's own required validation function]
We need to control both of these based on the active domain (domain access). This is likely useful in some role based module too. The current solution is to blindly hope that setting #required works on the widget and skipping cardinality as handling this is too hard via form_alters().
Note that this overlaps #1029298: Allow cardinality to be restricted (overriden and reduced) in the field instance settings.
Comments
Comment #13
smustgrave CreditAttribution: smustgrave at Mobomo commentedThink this can be covered in #1029298: Allow cardinality to be restricted (overriden and reduced) in the field instance settings
if I'm wrong please reopen updating issue summary for D10