[5.x]: Saving nested entries of a draft entry doesn't save them in a draft state · Issue #17062 · craftcms/cms · GitHub
More Web Proxy on the site http://driver.im/
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
I've got a site heavily relying on a few Matrix-based page builder fields (both in Cards and Inline-Editable block views). When I have an Entry with some blocks in the page builder field, and I create a Draft out of the entry, I would expect that any edits I make to any of the blocks in the various Matrix fields would be considered "Draft" edits, and wouldn't affect the live/current state of things until the "parent" entry's Draft is applied.
In practice, however, what happens is that as soon as I save a block's edits, the live/current version of the page renders with those "draft" changes.
Steps to reproduce
Create a Matrix field with some bloc-err, entry types assigned, in Cards view.
Create a Section that makes use of the Matrix field, and the templates needed to view that content.
Create a "parent" entry in that section, and give it some content in the Matrix field.
Create a Draft version of that entry.
Double-click one of the cards in the Matrix field
Make some edits and click "Save".
In the "parent" entry, switch away from the Draft created in step 4, to the Current state of the entry.
View the current/live rendered parent entry; the block should show those draft edits.
Expected behavior
What happens in Draft, stays in Draft. 🤫
Actual behavior
What happens in Draft, is made known to all. 🫢
Craft CMS version
5.6.14
PHP version
8.2.24
Operating system and version
Linux 5.15.167.4-microsoft-standard-WSL2
Database type and version
MySQL 8.0.36
Image driver and version
Imagick 3.7.0 (ImageMagick 6.9.11-60)
Installed plugins and versions
Button Box 5.0.0
CKEditor 4.6.0
Cloner 3.0.1
Cloudflare 3.0.2
Cloudflare R2 1.1.1
Element API 4.2.0
Feed Me 6.8.0
Field Manager 4.0.3
Freeform 5.10.5
Hyper 2.2.4
Icon Picker 3.0.3
LJ Range Slider 5.0.0
Maps 5.0.4
Matrix Extended v4.2.1
Minify 5.0.0
Navigation 3.0.6
oEmbed 3.1.3
Postmark 3.1.0
SEOmatic 5.1.11
Site Copy X 2.1.1
Super Dynamic Fields 5.0.1
Vite 5.0.1
The text was updated successfully, but these errors were encountered:
Create a Matrix field with some bloc-err, entry types assigned, in Cards view.
In #16002 (comment) you said you were using the “inline-editable blocks” view mode. Now you’re saying Cards view. Which is it?
Double-click one of the cards in the Matrix field
Make some edits and click "Save".
To be clear, you are editing the nested entry within a slideout, right?
I’m unable to reproduce this. When I edit the nested entry as part of a draft, the nested changes are only associated with the draft, not the Current revision of the owner entry. The only exception is if I open the nested entry in a new tab, and make my edits there. In that case the changes are fully saved to the canonical nested entry immediately. Which is working as expected. The changes in #16002 are only meant to affect editing entries within a slideout.
It's happening to me in both views. I initially had things in inline-editable blocks, but when I was troubleshooting the issue I saw your mention at the top of #16002 of card view, so I tried that as well, with no change in the outcome.
But... I think I figured out what's happening: we have nested Matrix blocks. I've got a Page Builder field that only has what I consider to be "Container" type blocks (eg Regular, Columns, Slideshow, or Tabs), and inside each of those "Containers", there's another Matrix field I've labeled "Content Blocks", with things like Header, Accordion, Image, etc.
When I change any of the Container blocks, those properly adhere to the Draft state of the parent entry. It's when I change any of the nested "Content Blocks" elements that the changes show up both in the Draft and Live versions of an entry.
What happened?
Description
Related to #16002.
I've got a site heavily relying on a few Matrix-based page builder fields (both in Cards and Inline-Editable block views). When I have an Entry with some blocks in the page builder field, and I create a Draft out of the entry, I would expect that any edits I make to any of the blocks in the various Matrix fields would be considered "Draft" edits, and wouldn't affect the live/current state of things until the "parent" entry's Draft is applied.
In practice, however, what happens is that as soon as I save a block's edits, the live/current version of the page renders with those "draft" changes.
Steps to reproduce
Expected behavior
What happens in Draft, stays in Draft. 🤫
Actual behavior
What happens in Draft, is made known to all. 🫢
Craft CMS version
5.6.14
PHP version
8.2.24
Operating system and version
Linux 5.15.167.4-microsoft-standard-WSL2
Database type and version
MySQL 8.0.36
Image driver and version
Imagick 3.7.0 (ImageMagick 6.9.11-60)
Installed plugins and versions
The text was updated successfully, but these errors were encountered: