Split from #2050801: Unify handling of default values between base and configurable fields
'default_value_callback' functions are currently only used for configurable fields, but base fields could easily be made to work with them too.
+ we're trying to limit the amount of code that has to work directly with the raw $field / $instance ConfigEntities specific to Field API "configurable fields", and establish FieldDefinitionInterface as the generic tool.
API changes:
dynamic 'default_value_function' callbacks change signatures:
before: callback(EntityInterface $entity, Field $field, FieldInstance $instance, $langcode)
after: callback(EntityInterface $entity, FieldDefinitionInterface $field_definition)
Comment | File | Size | Author |
---|---|---|---|
#1 | default_value_callback-2060907-1.patch | 4.92 KB | yched |
Comments
Comment #1
yched CreditAttribution: yched commentedPatch is a diff on top of #2050801: Unify handling of default values between base and configurable fields
Comment #2
yched CreditAttribution: yched commentedIs happening in #2226267: Improve default value handling of fields to be consistent