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_target on the form element instead of manually loading and saving the value.
  • Default the configuration to node, media, user, taxonomy_term, and block_content.
  • Update the Field labels exporter so configured non-bundle entity types such as user can 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, user field rows use entity_type = user and bundle = 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 user field-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.

Command icon 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

jrockowitz created an issue. See original summary.

jrockowitz’s picture

Issue summary: View changes
jrockowitz’s picture

Status: Active » Needs review

  • jrockowitz committed a117424e on 1.0.x
    feat: #3582692 Add configuration to select which entity types are...
jrockowitz’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.