Skip to content
Merged
Show file tree
Hide file tree
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: 4 additions & 2 deletions upload-api/migration-sitecore/libs/contenttypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -673,12 +673,13 @@ function singleContentTypeCreate({ templatePaths, globalPath, sitecore_folder, a
const templatesComponentsPath = [];
let templatesStandaedValuePath = {};
let templatesMetaDataPath = {};
const separator = path?.sep;
for (let i = 0; i < newPath?.length; i++) {
if (findExactPath(newPath?.[i], 'data.json')) {
const data = helper?.readFile(path?.join?.(templatePaths, newPath?.[i]));
if (data?.item?.$?.template === 'template section') {
templatesComponentsPath?.push({
pth: path?.join?.(templatePaths, newPath?.[i] ?? '')?.split('/{')?.[0],
pth: path?.join?.(templatePaths, newPath?.[i] ?? '')?.split(`${separator}{`)?.[0],
obj: data
});
} else if (data?.item?.$?.template === 'template') {
Expand Down Expand Up @@ -713,11 +714,12 @@ function ExtractContentTypes(sitecore_folder, affix, configData) {
config = configData;
const folder = read(sitecore_folder);
const templatePaths = [];
const separator = path?.sep;
for (let i = 0; i < folder?.length; i++) {
if (folder?.[i]?.includes('templates') && folder?.[i]?.endsWith('data.json')) {
const data = helper?.readFile(path?.join?.(sitecore_folder, folder?.[i]));
if (data?.item?.$?.template === 'template') {
templatePaths?.push(path?.join?.(sitecore_folder, folder?.[i])?.split('/{')?.[0]);
templatePaths?.push(path?.join?.(sitecore_folder, folder?.[i])?.split(`${separator}{`)?.[0]);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion upload-api/src/helper/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const saveZip = async (zip: any, name: string) => {
const newMainFolderName = name;
const keys = Object.keys(zip.files);
let filePathSaved = undefined;
const sitecoreFolders = ['installer', 'items', 'metadata', 'properties'];
const sitecoreFolders = ['blob', 'installer', 'items', 'metadata', 'properties'];

for await (const filename of keys) {
const file = zip.files[filename];
Expand Down