-
Notifications
You must be signed in to change notification settings - Fork 642
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
[3.x]: Problem with Save as new entry feature #11959
Comments
The same issue also occurs on Craft 4, without any visible errors. |
Yikes, that’s definitely a bug. It also loads the edit page for the duplicated entry, despite the URL still showing the original entry’s ID. I’ve fixed this so the new entry never gets committed to the database, and the error messages are displayed back on the original entry, for the next Craft 3 release (f822ec1).
That’s debatable. The current behavior is respecting what you’ve submitted in the form, including the Enabled setting. It would be weird if it respected most of the form settings (e.g. changes to the Title), but not the Enabled setting. If you want the duplicated entry to be saved as disabled, you can mark the entry as disabled, then press “Save as a new entry”, and the posted status will be respected. That said, I do see the other side of the argument. From a workflow perspective, most people are going to duplicate the entry and then start making changes to it. We had a plan to address this for Craft 4, but unfortunately we couldn’t implement it in time for the 4.0 release. You can subscribe to #10244 for updates on it.
@jeroenverfallie Craft 4 will duplicate the entry as-is, without validating it. |
Craft 3.7.55 is out with that fix. |
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. |
We just addressed this for Craft 5 (#12303). Going forward, entries created via “Save as a new entry” will start off in an unpublished draft state. |
What happened?
Description
In my opinion, there are some issues with the Save as new entry feature.
If I create a new entry from an existing entry by clicking on Save as new entry, and the current entry does not pass validation, Craft displays an error message for the current entry but still create a new entry with the errors of the current entry.
The status of the new entry is live. According to me, the entry should be either Disabled or Draft. Otherwise, the entry is returned directly via queries, which doesn't make sense to me. Unless I misunderstand how it works.
Steps to reproduce
Expected behavior
Prevent entry creation if current contains errors or change status for Disabled or Draft
Actual behavior
The current entry is not saved but the copy is saved with status Live
Craft CMS version
3.7.54
PHP version
8.1
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: