-
Notifications
You must be signed in to change notification settings - Fork 672
[5.x]: Changes to nested elements don't result in a revision being created until the parent is saved #16248
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
Comments
This is working as expected. When you use the element index view mode, the nested entries aren’t really treated as part of the entry content in the way they wood when you use the inline-editable or cards views. That said, we should at least make it possible for nested entries to track their own revisions. I’ve added that to our Linear project. |
To confirm it's expected that edits to nested elements that are saved don't result in a revision being created on the parent until the parent itself being saved even if there have been no changes on the parent itself?
It feels a little confusing that a revision is created a step 4. I would either expect a revision of the parent being created a step 3 (I understand you're saying this shouldn't happen) or no revision is created at step 4 unless changes had occured on the parent itself. |
@brandonkelly Is there a GitHub issue for that? Any chance of it being included in 5.7? We’ve had some problems with missing content related to nested elements, I suspect enabling support for revisions may help mitigate the issue. |
Just made it possible to enable versioning for Matrix fields, for Craft 5.7 🎉 (#17008) |
Craft 5.7.0 is out with that change. |
What happened?
Description
When editing and saving a nested element a revision is not created until after you save the parent despite the changes to nested element being applied to the canonical element. This can be observed when using a Matrix field in table view mode (inline mode does not exhibit this behaviour). We also see this issue within Commerce when managing Products/Variants, as well as in our own nested elements.
Steps to reproduce
Requires a Matrix field with oneEntry type and field. The Matrix field should be set to "Display as an element index" and "Display in a table".
At the 1:00 minute mark the changes to the Matrix Entry are "live" so it doesn't appear to be a UI bug with the parent Entry not tracking changes. Craft does know something has changed as it will create the revision with the edits to the Matrix Entry when resaving the parent.
Expected behavior
When performing step 3 a revision is created.
Actual behavior
When performing step 3 a revision isn't created.
nested-element-revisions.mp4
Craft CMS version
5.5.4
PHP version
8.2.24
Operating system and version
Linux 6.11.6-orbstack-00279-g28c6c77332e6
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
No response
The text was updated successfully, but these errors were encountered: