Skip to content
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

[5.x]: Changes to nested elements don't result in a revision being created until the parent is saved #16248

Open
ryansupercool opened this issue Nov 30, 2024 · 0 comments
Labels

Comments

@ryansupercool
Copy link

ryansupercool commented Nov 30, 2024

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".

  1. Create a new Entry and save.
  2. A a new Matrix Entry and save, note a revision has been created.
  3. Edit the Matrix Entry and save, note a revision hasn't been created. If you were to view the parent Entry on the frontend you will observe that the Matrix Entry edit is published.
  4. Save the parent Entry, note a revision has now been created.

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

@ryansupercool ryansupercool changed the title [5.x]: Changes to nested elements don't result in revision being created until the parent is saved [5.x]: Changes to nested elements don't result in a revision being created until the parent is saved Nov 30, 2024
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

1 participant