"Discard changes" loses draft relations
Node Version
20
NPM/Yarn/PNPM Version
yarn 1
Strapi Version
5.23.1
Operating System
MacOS
Database
SQLite
Javascript or Typescript
Javascript
Reproduction URL
No response
Bug Description
When pressing "Discard changes" (what I assume that happens) a copy is made from the published version of the document, to be made the new draft (the only way a draft gets a new id).
When doing this, draft relations are lost, as published versions of documents do not contain draft relations.
So for example:
I have a document with 2 relations, one still in draft. I make a change to the title (or any other random field). I regret the change, I press "discard changes", and without me knowing, I've list that one draft relation, now i only have the one published.
Steps to Reproduce
- save a draft
- press "discard changes"
- be sad that draft relations are now gone
Expected Behavior
I want to "discard" my changes, so going back to my previous draft. Which included draft relations. It doesn't make any (non-technical) sense I now lost data.
Logs
Code Snippets
No response
Media
No response
Additional information
No response
Confirmation Checklist
- I have checked the existing issues for duplicates.
- I agree to follow this project's Code of Conduct.
Source: strapi/strapi