fix: Changed the mapper path from contentDir to backupDir for taxonom…#2438
Merged
cs-raj merged 1 commit intov2-beta-devfrom Feb 27, 2026
Merged
fix: Changed the mapper path from contentDir to backupDir for taxonom…#2438cs-raj merged 1 commit intov2-beta-devfrom
cs-raj merged 1 commit intov2-beta-devfrom
Conversation
…y and extension mapper
aman19K
approved these changes
Feb 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: Taxonomy fields removed during content-types import (contentDir vs backupDir)
Problem
During import, taxonomy fields on content types were being removed instead of preserved. That led to:
Root cause
The import flow uses two base paths after backup:
contentDir– original export folder (user-provided path)backupDir– copy created bybackupHandler(e.g._backup_123)The taxonomies module writes its success file to
backupDir/mapper/taxonomies/success.json.The extensions module writes pending extensions to
backupDir/mapper/extensions/pending_extensions.js.Content-types was reading both from
contentDir(mapper/taxonomies/success.json and mapper/extensions/pending_extensions.js).So content-types never saw the files written in the current run. For taxonomies,
lookUpTaxonomygot missing/empty data, treated every taxonomy as “not in stack,” and stripped taxonomy fields from schemas.Solution
Content-types now reads mapper outputs from the same base as the modules that write them:
Taxonomy success
taxonomiesPathis built fromimportConfig.backupDirinstead ofimportConfig.contentDir, so it points tobackupDir/mapper/taxonomies/success.json.Pending extensions
extPendingPathis built fromimportConfig.backupDirinstead ofimportConfig.contentDir, so it points tobackupDir/mapper/extensions/pending_extensions.js.Rule used: mapper and any file written during import →
backupDir; export content (read-only source) →contentDir.Changes
packages/contentstack-import/src/import/modules/content-types.tstaxonomiesPath:contentDir→backupDirextPendingPath:contentDir→backupDirVerification