Loading
feat: #3620920 Allow data definitions to declare a default value
Closes #3620920
Add getDefault() and hasDefault() to DataDefinitionInterface and setDefault() to DataDefinition. The value is stored under the 'default' definition key. hasDefault() distinguishes a declared NULL default from no default.
The default value is metadata only. TypedDataManager::create(), applyDefaultValue() and validation do not use it.
The names differ from the issue summary because FieldDefinitionInterface already declares getDefaultValue(FieldableEntityInterface) and BaseFieldDefinition uses the 'default_value' key.
FieldConfigBase implements the interface without extending DataDefinition and reports no default. BaseFieldOverride forwards to its base field definition.
Generated with the help of an LLM.