From 893906b627e98ff1b6001576a9bee7184877566c Mon Sep 17 00:00:00 2001 From: Vikram Kalta Date: Mon, 1 Jul 2024 22:20:05 +0100 Subject: [PATCH] fix: fixed missing plugin id in ct schema --- packages/contentstack-import/src/utils/extension-helper.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/contentstack-import/src/utils/extension-helper.ts b/packages/contentstack-import/src/utils/extension-helper.ts index 073fcc1551..fd5ca01f92 100644 --- a/packages/contentstack-import/src/utils/extension-helper.ts +++ b/packages/contentstack-import/src/utils/extension-helper.ts @@ -21,6 +21,7 @@ export const lookupExtension = function ( const fs = new FsUtility({ basePath: config.backupDir }); const extensionPath = join(config.backupDir, 'mapper/extensions', 'uid-mapping.json'); const globalfieldsPath = join(config.backupDir, 'mapper/globalfields', 'uid-mapping.json'); + const marketPlaceAppsPath = join(config.backupDir, 'mapper/marketplace_apps', 'uid-mapping.json'); for (let i in schema) { if (schema[i].data_type === 'group') { @@ -72,9 +73,12 @@ export const lookupExtension = function ( } else if (schema[i].data_type === 'json' && schema[i].hasOwnProperty('plugins') && schema[i].plugins.length > 0) { const newPluginUidsArray: any[] = []; const data = fs.readFile(extensionPath) as Record; + const marketPlaceAppsData = fs.readFile(marketPlaceAppsPath) as { extension_uid: Record }; schema[i].plugins.forEach((extension_key_value: string) => { if (data && data.hasOwnProperty(extension_key_value)) { newPluginUidsArray.push(data[extension_key_value]); + } else if (marketPlaceAppsData && marketPlaceAppsData.extension_uid && marketPlaceAppsData.extension_uid.hasOwnProperty(extension_key_value)) { + newPluginUidsArray.push(marketPlaceAppsData.extension_uid[extension_key_value]); } }); schema[i].plugins = newPluginUidsArray;