Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions ui/src/pages/Migration/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ const Migration = () => {
? legacyCmsData?.all_cms?.find(
(cms: ICMSType) => cms?.cms_id === projectData?.legacy_cms?.cms
)
: undefined;
: DEFAULT_CMS_TYPE;

// Look up CMS by config's cmsType (same parent-matching logic as LoadSelectCms.filterCMSData)
const configCmsData: ICMSType | undefined = (configCmsType && validateArray(legacyCmsData?.all_cms))
Expand All @@ -321,9 +321,7 @@ const Migration = () => {
// Use stored CMS if its parent matches config's cmsType (preserves specific version like "Sitecore v9").
// Otherwise, config takes precedence (CMS type was changed in config).
const selectedCmsData: ICMSType =
(storedCmsData && storedCmsData?.parent?.toLowerCase() === configCmsType)
? storedCmsData
: (configCmsData ?? storedCmsData ?? DEFAULT_CMS_TYPE);
storedCmsData ?? DEFAULT_CMS_TYPE;
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says config’s cmsType is the source of truth and that selection should prefer config when it differs, but selectedCmsData is now always storedCmsData (falling back to DEFAULT_CMS_TYPE). This appears to drop the config-vs-stored reconciliation behavior and can select the wrong CMS when config changes; either restore the previous parent-matching/precedence logic or update the comments and remove the config lookup entirely to match the intended behavior.

Suggested change
storedCmsData ?? DEFAULT_CMS_TYPE;
configCmsData && storedCmsData && storedCmsData.parent?.toLowerCase() === configCmsType
? storedCmsData
: (configCmsData ?? storedCmsData ?? DEFAULT_CMS_TYPE);

Copilot uses AI. Check for mistakes.

const selectedFileFormatData: ICardType | undefined = validateArray(
selectedCmsData?.allowed_file_formats
Expand Down