8000 [5.x]: Saving nested entries of a draft entry doesn't save them in a draft state · Issue #17062 · craftcms/cms · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[5.x]: Saving nested entries of a draft entry doesn't save them in a draft state #17062

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

Open
Michael-Paragonn opened this issue Apr 10, 2025 · 3 comments
Labels

Comments

@Michael-Paragonn
Copy link

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

  1. Create a Matrix field with some bloc-err, entry types assigned, in Cards view.
  2. Create a Section that makes use of the Matrix field, and the templates needed to view that content.
  3. Create a "parent" entry in that section, and give it some content in the Matrix field.
  4. Create a Draft version of that entry.
  5. Double-click one of the cards in the Matrix field
  6. Make some edits and click "Save".
  7. In the "parent" entry, switch away from the Draft created in step 4, to the Current state of the entry.
  8. 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
@brandonkelly
Copy link
Member
  1. 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?

  1. Double-click one of the cards in the Matrix field
  2. 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.

@Michael-Paragonn
Copy link
Author
Michael-Paragonn commented Apr 14, 2025

Which is it?

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.

@Michael-Paragonn
Copy link
Author

@brandonkelly Any updates on this?

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
0