payloadcms / next-payload

A utility to deploy Payload serverlessly within a Next.js app
308 stars 44 forks source link

Incorrect Published Status: Changed when drafts are enabled #69

Closed edwardbc closed 5 months ago

edwardbc commented 1 year ago

When using next-payload with drafts enabled on a Collection type, the Editor always displays "Changed - Revert to Published" when opening an item without doing edits or actions.

Steps:

  1. Clone next-payload-demo
  2. Modify Pages.ts to add
    versions: {
    drafts: true,
    },
    1. In the admin, create a new Page and hit Publish
    2. Open the editor of that page; the status is immediately updated to "Changed - Revert to Published"

Note: I tested the same collection and connecting to the same database from a standalone Payload install (no next-payload) and when opening the editor on the item, it does display Published status properly.

johannesschaffer commented 10 months ago

Same problem here with Payload 2 and Next 14. Both localhost and on Vercel.

ghost commented 10 months ago

Having this issue as well.

jacobsfletch commented 5 months ago

Hey there @edwardbc, @johannesschaffer, and @ficeco, this repo will soon be archived because it's been merged into the main Payload repo here: https://github.com/payloadcms/payload/tree/main/packages/next. Payload 3.0 ships with native support for Next.js and is currently out in beta here: https://github.com/payloadcms/payload-3.0-demo. I'm going to close this issue now but feel free to keep the conversation going either as a GitHub Discussion or on Discord. If think issue persists, feel free to open a new ticket on either the demo repo or the monorepo with the 3.x-beta label, and be sure to include a reproduction so we can fix it faster.