Problem/Motivation

Consider this workflow:

1. developer creates a new taxonomy term on their local environment
2. our module adds the two fields "field_allowed_users" and "field_allowed_roles" automatically to the newly created vocabulary
3. developer commits the resulting config change, that includes the two new fields
4. developer deploys the change to the dev/staging version of the site

During configuration import:

1. the site creates the new taxonomy dictionary
2. the module adds the fields to it like in the step 2 above
3. the site configuration import process also tries to create the fields because they were exported into the configuration
4. config import fails with this error:

In ConfigImportCommands.php line 290:


    The import failed due to the following reasons:

    Deleted and replaced configuration entity "field.field.taxonomy_term.locale.field_allowed_users"

    Deleted and replaced configuration entity "field.field.taxonomy_term.locale.field_allowed_roles"

    Deleted and replaced configuration entity "core.entity_form_display.taxonomy_term.locale.default"

Proposed resolution

We should detect whether a taxonomy term is created as part of a configuration import, and not add the fields in that case.

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

vermario created an issue. See original summary.

  • vermario committed 34f95724 on 1.0.x
    #3549276: Only create fields if we are not creating vocabulary during...
vermario’s picture

Status: Active » Fixed

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

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

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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