Error upload asset to a Media collection when relatedTo as field in another collection
Describe the Bug
Logging error when trying to upload asset to a Media collection that is linked to another collection as a field. Everything seems to process properly and UI does not crash but the following error is logged.
Happens when trying create new and editing Media collection item from relatedTo collection.
[09:13:05] ERROR: Error: Could not find field schema for given path "undefined"
at buildFormState (webpack-internal:///(rsc)/./node_modules/@payloadcms/ui/dist/utilities/buildFormState.js:81:11)
at Object.buildFormState [as form-state] (webpack-internal:///(rsc)/./node_modules/@payloadcms/next/dist/routes/rest/buildFormState.js:21:113)
at eval (webpack-internal:///(rsc)/./node_modules/@payloadcms/next/dist/routes/rest/index.js:589:45)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Link to the code that reproduces this issue
https://github.com/codedawi/payload-v3-media-bug
Reproduction Steps
Configure Media collections of upload type.
Configure People collections with field profile that links to media upload type.
Create new or Edit People collection and then click to upload profile.
On redirect to the Media page upload for profile field it will through this error in the logs. Page seems to function fine though. This error is ONLY happens when being redirected to linked Media field from different collection (uploading Media directly to that collection doesn't result in error.
Which area(s) are affected? (Select all that apply)
area: ui
Environment Info
Payload: 3.0.0-beta.118 Next.js: 15.0.1
I am also experiencing the same issue -- when trying to upload asset to a Media collection that is linked to another collection as a field.
Payload: 3.0.0-beta.125 Next: 15.0.0
Is there a fix for this?
This issue has been marked as stale due to lack of activity.
To keep this issue open, please indicate that it is still relevant in a comment below.
This issue was automatically closed due to lack of activity.
Closing as cannot reproduce on latest version 3.25.0.
This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.