Repository: payloadcms/payload (TypeScript)

Issue:
Relationship fields expects ID instead of object in localized LexicalEditor

### Discussed in https://github.com/payloadcms/payload/discussions/14212

<div type='discussions-op-text'>

<sup>Originally posted by **Pathius** October 16, 2025</sup>
In our situation we have this `richText` field
```ts
export const introductionField = (config: Config): Field => {
	return {
		name: 'introduction',
		type: 'richText',
		localized: true,
		required: config.required,
		admin: { description: 'Introduction text for the page' },
		editor: richTextEditorConfig(),
	};
};
```

Coming along this custom `LexicalEditor`
```ts
import type { LexicalEditorProps } from '@payloadcms/richtext-lexical';
import {
	BlocksFeature,
	FixedToolbarFeature,
	InlineToolbarFeature,
	lexicalEditor,
	LinkFeature,
	RelationshipFeature,
} from '@payloadcms/richtext-lexical';

import { ALL_PAGE_COLLECTIONS } from '~/fields/pageType/pageType';
import { getTranslatedLabel } from '~/utilities/getTranslatedLabel';

export const richTextEditorConfig = (config?: Partial<LexicalEditorProps>) =>
	lexicalEditor({
		features: ({ defaultFeatures }) => [
			...defaultFeatures,
			LinkFeature({
				enabledCollections: ALL_PAGE_COLLECTIONS,
				fields: ({ defaultFields }) => defaultFields,
			}),
			RelationshipFeature({
				enabledCollections: ALL_PAGE_COLLECTIONS,
			}),
			BlocksFeature({
				blocks: [
					{
						slug: 'code',
						interfaceName: 'CodeBlock',
						labels: {
							singular: getTranslatedLabel('fieldLabels:codeBlock'),
							plural: getTranslatedLabel('fieldLabels:codeBlocks'),
						},
						fields: [
							{
								name: 'code',
								type: 'code',
								label: getTranslatedLabel('fieldLabels:code'),
								required: true,
								admin: {
									language: 'javascript',
								},
							},
							{
								name: 'language',
								type: 'select',
								label: getTranslatedLabel('fieldLabels:language'),
								defaultValue: 'html',
								options: [
									{ label: 'HTML', value: 'html' },
									{ label: 'JavaScript', value: 'javascript' },
									{ label: 'TypeScript', value: 'typescript' },
									{ label: 'CSS', value: 'css' },
									{ label: 'JSON', value: 'json' },
									{ label: 'Python', value: 'python' },
									{ label: 'SQL', value: 'sql' },
									{ label: 'Shell', value: 'shell' },
									{ label: 'Plain Text', value: 'plaintext' },
								],
							},
						],
					},
				],
			}),
			FixedToolbarFeature(),
			InlineToolbarFeature(),
		],
		...config,
	});
```

Problem that we are facing is that whenever we click on "Publish in English" it throws an error "Relationship value should be a string or number. The Lexical Relationship component should not receive the populated value object."

<img width="1170" height="601" alt="obraz" src="https://github.com/user-attachments/assets/95f7ed91-9f4d-4705-a270-df0ba6c9d7ab" />

<img width="1217" height="448" alt="obraz" src="https://github.com/user-attachments/assets/6c1b3cf0-f5e3-4388-8ebf-82235b2f9530" />

This error does not happen when:
- we save collection as `draft`
- we publish it to all locales

Another thing is that even the fact that error is displayed, we are still having an `value` as object in API (which is something that we want). Question is - how can we prevent displaying this error, we are expecting the `value` to be an object and not to perform a lot of API calls based on `value` being an ID.</div>



Fix (patch):
diff --git a/packages/ui/src/elements/PublishButton/index.tsx b/packages/ui/src/elements/PublishButton/index.tsx
index 249ca17edad..fcecc28ed5e 100644
--- a/packages/ui/src/elements/PublishButton/index.tsx
+++ b/packages/ui/src/elements/PublishButton/index.tsx
@@ -170,6 +170,7 @@ export function PublishButton({ label: labelProp }: PublishButtonClientProps) {
       }
 
       const params = qs.stringify({
+        depth: 0,
         publishSpecificLocale: locale,
       })