payloadcms / payload

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.
https://payloadcms.com
MIT License
24.94k stars 1.59k forks source link

Only one item in a collection can a version with status "Current Published Version" #8502

Closed stofolus closed 1 month ago

stofolus commented 1 month ago

Link to reproduction

No response

Environment Info

Node: 20.17.0
npm: 10.8.2
Yarn: N/A
pnpm: 9.0.2

payload: 3.0.0-beta.108 (I have used 108 fresh from the template and 110 in my own project with the same results)
  next: 15.0.0-canary.160
  @payloadcms/db-mongodb: 3.0.0-beta.108
  @payloadcms/email-nodemailer: 3.0.0-beta.108
  @payloadcms/graphql: 3.0.0-beta.108
  @payloadcms/live-preview: 3.0.0-beta.108
  @payloadcms/live-preview-react: 3.0.0-beta.108
  @payloadcms/next/utilities: 3.0.0-beta.108
  @payloadcms/plugin-cloud: 3.0.0-beta.108
  @payloadcms/plugin-form-builder: 3.0.0-beta.108
  @payloadcms/plugin-nested-docs: 3.0.0-beta.108
  @payloadcms/plugin-redirects: 3.0.0-beta.108
  @payloadcms/plugin-seo: 3.0.0-beta.108
  @payloadcms/richtext-lexical: 3.0.0-beta.108
  @payloadcms/translations: 3.0.0-beta.108
  @payloadcms/ui/shared: 3.0.0-beta.108
  react: 19.0.0-rc-5dcb0097-20240918
  react-dom: 19.0.0-rc-5dcb0097-20240918

Describe the Bug

Only the latest saved or restored version in a whole collection can have the status "Current Published Version" on one of it's versions in the version view. This means that if I save Page 1 the latest version of that item will have that status but as soon as I save Page 2 there will be no latest version on page 1.

https://github.com/user-attachments/assets/7f0b8322-d0eb-49ee-a90f-8012c626b293

Reproduction Steps

A fresh template will work and then have two or more pages where you

  1. Check page versions for "Current Published Version"
  2. Make a change and publish that page
  3. Make sure that you now see a "Current Published Version"

Go to another page and repeat and then go back to the first page. The status should now be gone

Adapters and Plugins

No response

r1tsuu commented 1 month ago

Fixed in https://github.com/payloadcms/payload/pull/8505

github-actions[bot] commented 1 month ago

This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.

github-actions[bot] commented 1 month ago

🚀 This is included in version v3.0.0-beta.111