Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save as new entry applies changes to *current* entry and creates a new one too #10204

Closed
peteeveleigh opened this issue Dec 3, 2021 · 5 comments
Labels

Comments

@peteeveleigh
Copy link

peteeveleigh commented Dec 3, 2021

When editing an existing entry and clicking "Save as new entry" the changes are saved to the original entry as well as being used to make a new one.

Expected behaviour

The new entry should be created with the updated content but the original entry is left untouched

Steps to reproduce

  1. Open an existing entry
  2. Make some changes
  3. Click "save as new entry" from the save dropdown
  4. A new entry will have been created with the changes but the changes

Additional info

  • Craft version: 3.7.23
  • PHP version: 7.4.26
  • Database driver & version: MySQL 5.7.36
  • Plugins & versions:
    Screenshot 2021-12-03 at 10 46 05
@peteeveleigh
Copy link
Author

After speaking with Oli I can see that this isn't a bug and is working as intended.
The original entry is getting saved as a draft as the new entry is created and published.

I know the publishing/drafts flow has been subject to considerable back and forth and there have been a lot of opinions on the subject. But this feels very counter-intuitive. In the case of saving as a new entry the author's intention wasn't to update the original entry. Should the draft either not be created, or be deleted automatically? I can't think of a case where an author would want the changes they made for the new entry to apply to the original, else they wouldn't be creating a new entry from it.

@brandonkelly
Copy link
Member

Correct, this is working as expected. Your changes are initially made to a provisional draft for the entry, and then you are duplicating that into a new entry, but that doesn’t actually affect the provisional draft.

In the case of saving as a new entry the author's intention wasn't to update the original entry.

Maybe, but maybe not. If you know from the start that you are intending to save the changes as a new entry, I suspect most people are duplicating the entry first, then making their changes.

I think the main thing we need to do is make it more obvious that you are editing a provisional draft. (Right now it’s only identified by the “– Edited” label within the revision menu button.) Then it won’t be as confusing as to why you are still seeing those edits, or think maybe they were also saved to the main entry. If you don’t want the edits, discarding them is just a button click away.

@peteeveleigh
Copy link
Author

Having thought a bit more about this I tend to agree with you @brandonkelly. It would be more logical to create the new entry before editing. But yes, also I think it needs to be made more obvious that it's a draft.

@brandonkelly
Copy link
Member

Changed for Craft 4 (#10467):

Screenshot of the top of an entry form, with a message saying that you are viewing your unsaved changes, and a button to discard them.

@brandonkelly
Copy link
Member

brandonkelly commented Oct 27, 2022

As of Craft 4.3 (released earlier this week), when you press “Save as a new entry” for a provisional draft (an entry with unsaved changes), the unsaved changes will automatically be discarded after the duplicate entry is created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants