-
Notifications
You must be signed in to change notification settings - Fork 685
Description
What happened?
Description
Possibly related: #18579
We've had several cases recently where clients report that their provisional draft changes for nested entries inexplicably disappear "when they save" – and I'm pretty sure I've figured out what is really happening.
It turns out that if a canonical/current nested entry is open in a slideout, and then edited via its dedicated edit page, the open slideout in that other tab is not updated with the provisional draft changes (i.e. it stays current/canonical).
Then, if the author happens to go back to the tab with the canonical nested entry in the open slideout and clicks "Save", Craft creates a new provisional draft under the hood before applying it, which overwrites the existing provisional draft.
CleanShot.2026-03-24.at.23.03.27.mp4
When this happens, the following warning will be logged to the web.log file:
2026-03-24 15:03:45 [web.WARNING] [craft\controllers\ElementsController::actionSaveDraft] Overwriting an existing provisional draft for element/user 186/1 {"memory":2016272}
TBH, I guess this is somewhere half-way between "you're holding it wrong" and a real bug :)
But, even though the steps leading up to this behaviour can appear a bit contrived, real authors are definitely running into this. I think part of the reason for it, is that the "Open in a new tab" link in the slideout is currently the only way for authors to navigate to the nested entries' dedicated edited pages, as well as the fact
If slideouts were updated/synced when their element is edited in a separate tab (similar to how it works for dedicated edit pages), that would eliminate this problem and would be the ideal solution IMO.
But, if that's not feasible, maybe Craft could at least throw up a warning/prompt before overwriting an existing provisional draft in cases like this, giving authors the choice of what to do (sort of similar to the filename conflict dialog for assets)?
Steps to reproduce
- Have a Matrix field using the "Cards" view mode. Create an entry in that field; save the nested entry and its owner.
- Double-click the nested entry to open its slideout. Don't make any content edits.
- Click the "Open in a new tab" link to open the nested entry's dedicated edit page in a new tab.
- Make some content changes to the nested entry in its dedicated edit page. Don't apply the provisional draft!
- Go back to the tab with the open slideout, and click the "Save" button in the slideout.
- Confirm that the existing provisional draft with the content changes made from the dedicated edit page in the other tab, has been overwritten (i.e. hard deleted).
Expected behavior
Open slideouts should keep track of their elements' draft status, similarly to dedicated edit pages. Alternatively, authors should be given some agency before Craft overwrites an existing provisional draft in cases like this (for example, the option to merge or discard the existing draft).
Actual behavior
Open slideouts are not keeping track of their elements' draft status, and Craft silently overwrites (i.e. hard deletes) existing provisional drafts.
Craft CMS version
5.9.17
PHP version
No response
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
None