Skip to content

[5.x]: Changes to deeply-nested entries are lost when their owner is edited and saved multiple times #18624

@mmikkel

Description

@mmikkel

What happened?

Description

This bug was found and described by @superflausch in #18620 (comment) (which I'm pretty sure is a completely separate issue, and the bug reported here is probably the real culprit for the "changes going missing" 🫠).

Based on @superflausch's comments in #18620, I'm able to consistently reproduce the following:

If a nested entry is edited and saved from its card slideout multiple times, without applying the owner entry's draft in-between, Craft does not persist changes to deeply-nested entries:

CleanShot.2026-03-25.at.16.40.34.mp4

Even adding a new deeply-nested entries to the nested Matrix field, when editing the top-level nested entry for the second time without first applying the root owner draft, does not persist. But, changes to other, non-Matrix fields (like the title, or a PlainText custom field) are persisted – it seems like it's just the nested Matrix field exhibiting this behavior:

CleanShot.2026-03-25.at.16.44.14.mp4

This could possibly be a regression introduced with the fix for #18537, as I'm not able to reproduce this behaviour on Craft 5.9.16.

Steps to reproduce

  1. Create a content model that looks like this:
    Pages (Section) → Page (Entry Type) → Sections (Matrix field, "Cards" mode) → Section (Entry Type) → Blocks (Matrix field, "Blocks" mode) → Text (Entry Type) → Text (Text field)
  2. Create a nested entry in the "Sections" field, and add a deeply-nested entry to its "Blocks" field. Save everything.
  3. From the root owner entry, double-click the "Section" nested entry card to open its slideout. Make a content change in a field inside the deeply-nested "Blocks" entry, and click "Save" in the slideout. Do not apply the root owner's provisional draft.
  4. Double-click the nested entry card to open its slideout a second time. Make another content change to the deeply-nested entry, and click "Save" in the slideout again.
  5. Double-click the nested entry card to open its slideout a third time. Notice that the previous content change to the deeply nested entry has not persisted.

Expected behavior

Actual behavior

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions