You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When having a collection with versions and draft enabled, the join fields are lost when setting draft to false.
I would expect also to get the join fields values since that is also shown that way in the admin panel.
For a draft category document that has a join field to posts, it is shown as follows in the admin panel with status indicating 'draft':
Join field exists in api response with checkbox draft unchecked:
Join field missing in api response with checkbox draft checked:
The join fields are also missing when querying with the local api:
Describe the Bug
When having a collection with versions and draft enabled, the join fields are lost when setting draft to false.
I would expect also to get the join fields values since that is also shown that way in the admin panel.
For a draft category document that has a join field to posts, it is shown as follows in the admin panel with status indicating 'draft':
Join field exists in api response with checkbox draft unchecked:
Join field missing in api response with checkbox draft checked:
The join fields are also missing when querying with the local api:
The join fields values seem to be removed in the
replaceWithDraftIfAvailable
function: https://github.com/payloadcms/payload/blob/4224c680023707fff7d67cacd9dbd75b77f4128c/packages/payload/src/versions/drafts/replaceWithDraftIfAvailable.tsLink to the code that reproduces this issue
https://github.com/dpnolte/payload-missing-join-fields-draft
Reproduction Steps
Which area(s) are affected? (Select all that apply)
db-mongodb
Environment Info
The text was updated successfully, but these errors were encountered: