Skip to content
Merged

Dev #1088

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
14 changes: 7 additions & 7 deletions api/src/services/wordpress.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,8 @@ function attachMediaTextFieldsToChildren(

const mediatypeField = fields?.find(
(f: any) =>
(f?.contentstackFieldType === 'single_line_text' ||
f?.contentstackFieldType === 'text') &&
(f?.backupFieldType === 'single_line_text' ||
f?.backupFieldType === 'text') &&
fieldMappedUnderModularChild(modularChild, f) &&
(f?.otherCmsField || '')?.toLowerCase() === 'mediatype',
);
Expand Down Expand Up @@ -1112,12 +1112,12 @@ function formatChildByType(child: any, field: any, assetData: any, fields?: any[
}
const asset = assetData[`assets_${id}`];

const groupCsUid = field?.contentstackFieldUid || '';
const groupCsUid = field?.backupFieldUid || '';
const isDirectChildOfThisGroup = (f: any) => {
const uid = f?.contentstackFieldUid || '';
if (groupCsUid && uid.startsWith(`${groupCsUid}.`)) {
const rest = uid.slice(groupCsUid.length + 1);
return Boolean(rest && !rest.includes('.'));
const uid = f?.backupFieldUid || '';
if (groupCsUid && uid?.startsWith(`${groupCsUid}.`)) {
const rest = uid?.slice(groupCsUid?.length + 1);
return Boolean(rest && !rest?.includes('.'));
}
const slug = getFieldName(childBlockName);
return Boolean(slug && f?.contentstackField?.includes(slug));
Expand Down
Loading