Open
Description
Describe the Bug
An error occurs when attempting to save the parent document after saving a child document.
Link to the code that reproduces this issue
https://github.com/tobiasiv/payload-reproduction/tree/nested-saves
Reproduction Steps
- Clone the reproduction repo (branch: nested-saves)
- Set the env variables
pnpm dev
- Go to collection Pages
- Open Page 1
- Open Post 1 via drawer
- Change title to "Post 2"
- Save the post
- Change title of Page 1 to "Page 2"
- Save the page
- This error appears: This relationship field has the following invalid relationships: [object Object] 0
Which area(s) are affected? (Select all that apply)
area: core
Environment Info
Binaries:
Node: 22.13.0
npm: N/A
Yarn: N/A
pnpm: 9.7.0
Relevant Packages:
payload: 3.19.0
next: 15.1.5
@payloadcms/db-postgres: 3.19.0
@payloadcms/email-nodemailer: 3.19.0
@payloadcms/graphql: 3.19.0
@payloadcms/next/utilities: 3.19.0
@payloadcms/payload-cloud: 3.19.0
@payloadcms/richtext-lexical: 3.19.0
@payloadcms/ui/shared: 3.19.0
react: 19.0.0
react-dom: 19.0.0
Operating System:
Platform: win32
Arch: x64
Version: Windows 11 Home
Available memory (MB): 16263
Available CPU cores: 8