diff --git a/packages/payload/src/fields/config/sanitize.ts b/packages/payload/src/fields/config/sanitize.ts index a6120c0e179..fc7464aa3df 100644 --- a/packages/payload/src/fields/config/sanitize.ts +++ b/packages/payload/src/fields/config/sanitize.ts @@ -17,7 +17,7 @@ import { baseIDField } from '../baseFields/baseIDField.js' import { setDefaultBeforeDuplicate } from '../setDefaultBeforeDuplicate.js' import { validations } from '../validations.js' import { sanitizeJoinField } from './sanitizeJoinField.js' -import { fieldAffectsData, tabHasName } from './types.js' +import { fieldAffectsData, fieldIsLocalized, tabHasName } from './types.js' type Args = { collectionConfig?: CollectionConfig @@ -249,7 +249,7 @@ export const sanitizeFields = async ({ ? `${joinPath ? joinPath + '.' : ''}${field.name}` : joinPath, joins, - parentIsLocalized: parentIsLocalized || field.localized, + parentIsLocalized: parentIsLocalized || fieldIsLocalized(field), requireFieldLevelRichTextEditor, richTextSanitizationPromises, validRelationships, diff --git a/packages/payload/src/fields/config/types.ts b/packages/payload/src/fields/config/types.ts index 3796da3ebb4..7434d50697d 100644 --- a/packages/payload/src/fields/config/types.ts +++ b/packages/payload/src/fields/config/types.ts @@ -647,7 +647,7 @@ export type RowField = { admin?: Omit fields: Field[] type: 'row' -} & Omit +} & Omit export type RowFieldClient = { admin?: Omit @@ -686,7 +686,7 @@ export type CollapsibleField = { label: Required } ) & - Omit + Omit export type CollapsibleFieldClient = { admin?: { diff --git a/packages/ui/src/forms/fieldSchemasToFormState/addFieldStatePromise.ts b/packages/ui/src/forms/fieldSchemasToFormState/addFieldStatePromise.ts index 8da6b4985ff..4a8539b410e 100644 --- a/packages/ui/src/forms/fieldSchemasToFormState/addFieldStatePromise.ts +++ b/packages/ui/src/forms/fieldSchemasToFormState/addFieldStatePromise.ts @@ -19,6 +19,7 @@ import { fieldHasSubFields, fieldIsHiddenOrDisabled, fieldIsID, + fieldIsLocalized, fieldIsSidebar, getFieldPaths, tabHasName, @@ -626,7 +627,7 @@ export const addFieldStatePromise = async (args: AddFieldStatePromiseArgs): Prom id, // passthrough parent functionality addErrorPathToParent: addErrorPathToParentArg, - anyParentLocalized: field.localized || anyParentLocalized, + anyParentLocalized: fieldIsLocalized(field) || anyParentLocalized, clientFieldSchemaMap, collectionSlug, data,