localizeStatus: Duplicate makes the copy a draft only in the current locale; other locales keep the source's published status

Aperta
#19,621 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@lazerg ci sta già lavorando.

Dal 16/11/2026.

Valutazione

Difficoltà
4/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
typescript
Ambito
backend, database

Direzione di ricerca

Start by tracing duplicateDocument and how localized _status values are copied when draft: true is set for the request locale. Reproduce with two or more locales where the source is published in each, then inspect the duplicate endpoint and relevant draft or localization tests. Done means the duplicate is draft in every locale; linked pull request #19622 is already open.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Bug Payload OSS
Describe the bug

With experimental.localizeStatus: true and versions.drafts.localizeStatus: true, duplicating a document creates the copy as a draft only in the locale of the request. In every other locale the copy takes the source document's _status. If the source is published in those locales, the copy is published there immediately, without anyone publishing it.

To reproduce
  1. Config: 2+ locales, experimental: { localizeStatus: true }, a collection with versions: { drafts: { localizeStatus: true } } and a localized field.
  2. Create a doc and publish it in all locales.
  3. In the admin, switch to locale en and click Duplicate.
  4. Check the copy's _status per locale (locale: 'all').

Expected: the copy is draft in every locale.
Actual: draft in en only; published in every other locale where the source is published.

Notes
  • duplicateDocument copies the source's localized _status together with the data, and draft: true only sets the current locale.
  • Same code in v3.85.1 and current 3.x.
  • Workaround: disableDuplicate: true (the REST duplicate endpoint ignores it, so it needs a hook too).
Environment

payload 3.85.1, @payloadcms/db-mongodb 3.85.1

Lingua principale
TypeScript
Stelle
45.8k
Fork
4.4k
Merge medio
3g 4h
PR unite (30g)
210

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di payloadcms/payload

Tutte le issue di payloadcms/payload

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.