Force import for taxonomy deletes all terms regardless if they're managed by structure sync

Created on 25 March 2022, about 3 years ago
Updated 4 April 2025, 3 days ago

Problem/Motivation

When you do a force import on taxonomies, even if a taxonomy vocabulary is not selected and does not exist in the structure sync data all the terms are deleted.

Steps to reproduce

  1. Create a taxonomy vocabulary named "Managed" and "Unmanaged"
  2. Add a couple terms to both vocabularies.
  3. Navigate to the structure sync configuration page, and select only "Managed" under the Export fieldset.
  4. Export the structure sync configuration using drush (drush cex --yes)
  5. Navigate to the structure sync configuration page and select "Managed" under the "Import" fieldset.
  6. Click Import taxonomies (force)
  7. Navigate to the "Unmanaged" taxonomy vocabulary and view the list of terms, which should not exist anymore.

Proposed resolution

Only selected taxonomy vocabularies that are managed by structure sync should be removed; not all taxonomy terms.

πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States droath

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • @mparker17 opened merge request.
  • πŸ‡¨πŸ‡¦Canada mparker17 UTC-4

    To make this easier to review, I've created a merge request.

    A brief glance at the code in the merge request suggests that it has no tests. The Structure Sync maintainers prefer to accept merge requests that have passing automated tests. If you need help writing tests, please ask: I would be happy to help!

Production build 0.71.5 2024