Follow-up to #2287727: Rename FieldConfig to FieldStorageConfig
Problem/Motivation
In the past couple weeks, the Core/Field API has settled on a terminology of :
- FieldStorageDefinition : the "shared" properties that define a storage bucket for field data, relevant for a given entity type
- FieldDefinition : the definition of an actual field atached to an actual bundle of the above entity type
This exactly replicates the split between "field" and "field instance" that comes from D7, and that is still used for configurable fields :
- FieldConfig is exactly what the Core/Field API uses as a FieldStorageDefinition
- FieldInstanceConfig is exactly what the Core/Field API uses as a FieldDefinition
This terminology split produces some very confusing artifacts (var names, class hierarchy), and forces you to switch brain modes when crossing between Core/Field and field.module.
#2283977: Create a new ConfigEntity type for storing bundle-specific customizations of base fields is adding a FieldConfigBase, with
- FieldConfig *not* extends FieldConfigBase
- FieldInstanceConfig extends FieldConfigBase
Proposed resolution
We should bite the bullet and apply our terminology consistently :
- what D7 called a $field is a FieldStorageDefinition
- what D7 called an $instance is a FieldDefinition
This is not a proposal at this point, that's what HEAD does already. We just have one subpart of the system that still uses the old terminology, while the system itself uses a new terminology (with one word, "field", being used as "that part" in one case and "the other part" in the other case - making it the perfect WTF :-)
Thus :
- FieldConfig should be renamed FieldStorageConfig
- entity type : field_storage_config,
- CMI names : field.storage.[entity_type].[field_name]
- FieldInstanceConfig should be renamed FieldConfig
- entity type : field_config,
- CMI names : field.field.[entity_type].[bundle].[field_name]
Given we're renaming A to B and C to A, it's much saner to approach this in two successive patches :
1. Rename FieldConfig to FieldStorageConfig -- done in #2287727: Rename FieldConfig to FieldStorageConfig
2. Rename FieldInstanceConfig to FieldConfig
Current patch does 1.
API changes
- renames FieldInstanceConfig to FieldConfig
- renames FieldInstanceConfigInterface to FieldConfigInterface
- renames FieldInstanceConfigStorage to FieldConfigStorage
- renames entity type ID from 'field_instance_config' to 'field_config'
- renames CMI records from field.instance.* to field.field.*
- renames hook_field_instance_config_*() to hook_field_config_*() (hook_ENTITY_TYPE_*)
- renames FieldInstanceConfigDeleteForm to FieldConfigDeleteForm
- renames FieldInstanceEditForm to FieldEditForm
- renames defaultInstanceSettings() to defaultFieldsettings()
- renames instanceSettingsForm to fieldSettingsForm()
form_id : field_ui_field_instance_edit_form --> field_ui_field_edit_form
route name: field_ui.instance_edit_$entity_type_id --> field_ui.field_edit_$entity_type_id
-----
Work happens in 2312093-rename-FieldInstanceConfig - helper issue is over at #2317047: Helper issue for #2312093: rename FieldInstanceConfig to FieldConfig