You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(next): status component incorrectly shows as published status on new documents saved as drafts when readVersions permissions are false (#14950)
### What?
Fixes incorrect `status` display when creating and saving new draft
documents in collections where users don't have readVersions permission.
### Why?
The `getVersions` function was incorrectly assuming any document with an
ID is published, causing the Status component to show "Published" for
newly created drafts. This happens when `readVersions` permission is
disabled because the code takes an early return path that doesn't query
the versions collection.
### How?
- Changed the early return logic in `getVersions.ts` to check the
document's `_status` field directly
- Returns `hasPublishedDoc = false` only when `_status === 'draft'`,
otherwise `true`
0 commit comments