[v4] Version view: the current draft and the published version of a localized collection both show "Previously Published"
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- next.js, react, typescript
Research direction
Read packages/ui/src/views/Versions/VersionPillLabel/getVersionLabel.ts and packages/ui/src/views/Version/index.tsx, especially the three version lookups described in the issue. Start by tracing how locale-specific _status values are read and how fetchVersion changes req.locale; compare that with the suggested fix and linked pull request #19527. Done means the draft and published versions show their expected labels and the compare dropdown includes the currently published version.
Written by the indexing model from the issue text.
Description
Describe the Bug
v4 turns on localizeStatus for collections with drafts and localized fields, so _status is stored per locale. The version view doesn't handle that yet:
- Labels. The versions are read with
locale: 'all', soversion._statusis an object such as{ en: 'draft', de: 'draft' }.getVersionLabelcompares it with'draft'and'published', matches neither, and ends at "Previously Published". - Lookups. The latest draft and the previous published version are looked up with
locale: 'all'and a_statusfilter, which matches nothing for a per-locale status (the root cause in #17923). The currently published version useslocale: req.locale, but thefetchVersioncall before it has already written'all'ontoreq.locale(#18246). None of the three is found, so "Current draft" and "Currently Published" never appear, and the compare dropdown only offers "Previous Version".
Suggested fix (we run this as a patch on beta.8): in getVersionLabel, use _status[currentLocale] when _status is an object. Run the three lookups with locale: userLocale, on isolateObjectProperty(req, ['fallbackLocale', 'locale']), because they run in parallel and each Local API call writes its locale onto the request (#18280 fixes that in general).
Link to the code that reproduces this issue
https://github.com/fabian-michael-asi/payload-v4-issue-repros
Reproduction Steps
- Clone,
cp .env.example .env,pnpm install. - Create a user and three versions of a post (draft, published, draft), then start the app:
pnpm payload createDocuments --slug users --documents '[{"data":{"email":"[email protected]","password":"test"}}]'
ID=$(pnpm -s payload createDocuments --slug posts --draft --locale en --documents '[{"data":{"title":"v1 draft","items":[{"label":"First item"}]}}]' --json | jq -r '.result.docs[0].id')
pnpm payload updateDocument --slug posts --id "$ID" --locale en --data '{"title":"v2 published","_status":"published"}'
pnpm payload updateDocument --slug posts --id "$ID" --locale en --draft --data '{"title":"v3 draft"}'
pnpm dev
- Open the post in English, then Versions, then "v3 draft": the pill says Previously Published, expected Current draft.
- Open "v2 published": Previously Published, expected Currently Published.
- "Comparing against" only offers "Previous Version", expected an entry for the currently published version.

Which area(s) are affected?
area: ui
Environment Info
Relevant Packages:
payload: 4.0.0-beta.8
next: 16.4.2
@payloadcms/db-mongodb: 4.0.0-beta.8
@payloadcms/richtext-lexical: 4.0.0-beta.8
@payloadcms/ui/shared: 4.0.0-beta.8
react: 19.3.1
Node: 24.22.2, pnpm: 12.18.0, darwin arm64
- Dominant language
- TypeScript
- Stars
- 45.8k
- Forks
- 4.4k
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 251
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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.
More from payloadcms/payload
-
db-d1-sqlite: upsert is aliased to updateOne, so payload.kv.set never inserts new keysPossibly taken @pcbeingused333 claimed this today. OpenBug db: d1-sqlite Payload OSS
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
payloadcms/payload#19766 ·
Maintainers usually reply within 1 day
-
Document bar (.doc-controls__content) overflows a 375 px viewport, clips "Created" and fails axe scrollable-region-focusablePossibly taken A pull request linked to this issue is open or already merged. Openarea: ui Bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
payloadcms/payload#19690 ·
Maintainers usually reply within 1 day
-
[v4] Blocks thumbnails croped 3:2Possibly taken @samiarif02 claimed this 2 days ago. Openarea: ui Bug Payload OSS status: needs-triage v3
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
payloadcms/payload#19609 ·
Maintainers usually reply within 1 day
-
Scheduled publish jobs are not deleted when their document is deleted (string id in the job, raw id in the cleanup)Possibly taken @volodymyrshk claimed this 10 days ago. Openarea: core Bug db: sqlite
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
payloadcms/payload#19448 ·
Maintainers usually reply within 1 day
-
plugin-multi-tenant: `isGlobal` collections redirect tenant-scoped users to `/admin` since 3.93.0 (GlobalViewRedirect prop-name mismatch)Possibly taken @JarrodMFlesch claimed this 10 days ago. OpenBug plugin: multi-tenant
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
payloadcms/payload#19420 · 1 assignee ·
Maintainers usually reply within 1 day
All issues in payloadcms/payload
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
milind-soni/OpenMausBot#6730 ·
Maintainers usually reply within 1 day
-
`@angular/[email protected]` depends on vulnerable Vite 7.3.7 - GHSA-p4f5-76q4-ffq7 (Critical RCE)Openarea: @angular/build
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
angular/angular-cli#34764 ·
Maintainers usually reply within 1 day
-
status/need-triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
google-gemini/gemini-cli#30384 · 1 comment ·
Maintainers usually reply within 1 day
-
P2
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
area:image documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day