payloadcms / payloadcms/payload
localizeStatus: fail to retrieve last version
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 44.8k
- Forks
- 4.2k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 53
Description
Describe the Bug
When using localizeStatus, in the edit view of a document, the retrieved document is the last draft document. This means that when editing and publishing directly (clicking on the publish button, modifications won't be retrieved).
Link to the code that reproduces this issue
https://github.com/matthieuMay/repro-draft
Reproduction Steps
The repro is a blank template with 2 new collections (Post and Guide) containing a localized title. The Post collection has { draft: { localizeStatus: true } }, the guide has { draft: true }
Go to post,
- create a new post
- fill in a title click save drafts
- modify the title click publish
- reload page, the first title will appear.
Do the same with guide, the second title will appear
Which area(s) are affected?
area: core
Environment Info
Detected the bug on a postgres project, repro is a sqlite
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked reproduction and compare the Post configuration using localizeStatus with the Guide configuration using draft: true. Trace the edit, save-draft, publish, and reload flow for the retrieved localized document. Done means the published title is shown after reloading, consistently across the reported database setups.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, sqlite, typescript
- Domain
- backend, databases, localization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100