Problem/Motivation
The Entity labels and Field labels exporters currently derive their scope from entity types with bundles. This makes the export list broader than needed and does not let site builders limit the output to the entity types they actually manage through this module.
The module should provide configuration for the entity types included in exports. The default configured entity types should be:
- node
- media
- user
- taxonomy_term
- block_content
The module also needs to support user for field labels even though it does not have bundles.
Proposed resolution
Add module configuration for the entity types included in Entity labels and Field labels exports.
Add a settings form that uses #config_target and stores the selected values in:
entity_labels.settings:entity_types
Implementation expectations:
- Add a module settings form for selecting exportable entity types.
- Use the config property
entity_types. - Use
#config_targeton the form element instead of manually loading and saving the value. - Default the configuration to
node,media,user,taxonomy_term, andblock_content. - Update the Field labels exporter so configured non-bundle entity types such as
usercan be exported. - Treat non-bundle entity types as having a single implicit bundle equal to the entity type ID for field-label export and import. For example,
userfield rows useentity_type = userandbundle = user. - Update field-label import, report, export, and route/title behavior as needed so this implicit-bundle pattern works consistently for
user. - Keep Entity labels bundle-based. Configured entity types without bundles should not produce Entity labels rows unless separate support is added in a follow-up issue.
- Preserve the existing per-request entity type and bundle filters so they continue to narrow the configured set.
Remaining tasks
- [ ] Add default configuration for
entity_types. - [ ] Add the settings form and route/link integration.
- [ ] Update field-label export logic to support configured non-bundle entity types such as
user. - [ ] Update field-label import logic to support the implicit bundle value for non-bundle entity types.
- [ ] Ensure configured non-bundle entity types do not break Entity labels export/report behavior.
- [ ] Add or update automated test coverage for defaults, configuration filtering, and
userfield-label export/import. - [ ] Update the README if needed.
User interface changes
A new admin settings form will be added so site builders can choose which entity types are included in exports.
API changes
A new module configuration property will be introduced:
entity_labels.settings:entity_types
No new public PHP API is required.
Data model changes
New module configuration is added for the selected entity types. No database schema changes are required.
Issue fork entity_labels-3582692
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
jrockowitz commentedComment #3
jrockowitz commentedComment #6
jrockowitz commented