craftcms / cms

Build bespoke content experiences with Craft.
https://craftcms.com
Other
3.23k stars 630 forks source link

[5.x]: Nested matrix entry types disappear when page is reloaded after making changes #15256

Closed sparkalow closed 3 months ago

sparkalow commented 3 months ago

What happened?

Description

When editing fields of a nested entry in a matrix field, the "changed" fields blue indicators show as expected. However, reloading the page results in the changed blocks disappearing. This only seems to happen with blocks set to "inline editable" display mode. Saving in this state will result in the blocks being deleted. Discarding changes will restore the missing bits.

Steps to reproduce

  1. Edit an entry that has a matrix field that contains a nested matrix field with multiple entries - set to display "inline editable blocks."
  2. Edit at least 2 of the nested matrix entries.
  3. Reload the page.

Expected behavior

All edits are shown in "draft" mode with changes hi-lighted.

Actual behavior

The changed nested entries no longer show and appear to have been deleted.

I've created a vanilla install with no plugins that can reproduce this consistently and can provide a db dump.

https://github.com/craftcms/cms/assets/3172002/e792f0a7-938d-4c55-8e20-af9161803726

Craft CMS version

Craft 5.2.3

PHP version

8.3.8

Operating system and version

Linux 6.6.31-linuxkit

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

i-just commented 3 months ago

Hi, thanks for reporting! I just raised a PR for this.

brandonkelly commented 3 months ago

Craft 5.2.4 is out with a fix for this. Thanks again!