craftcms/cms

[5.2.0-beta.3]: Exception thrown when creating a new entry in a Cards Matrix field nested in an inline-editable Matrix field, inside a global set

Closed this issue · 2 comments

What happened?

Description

If a Matrix field using the "Cards" view mode is nested inside another Matrix field using the "As inline-editable blocks" view mode, and the inline-editable field is added to a global set, attempting to create a new entry in the inner "Cards" field will cause a server-side exception:

CleanShot.2024-06-06.at.22.41.04.mp4

Here's a stack trace for the error: https://pastebin.com/L7mUDEkw

As far as I can tell, this only happens when a "Cards" Matrix field is nested inside an inline-editable field, and only in global sets.

If both Matrix fields are either using the "Cards" or the inline-editable view mode, it's fine.

If the global set is saved in-between creating the outer (inline-editable) nested entry and the inner (cards) nested entry, the exception is not thrown.

I'm not able to reproduce the issue on 5.1.9.

Steps to reproduce

  1. Add a Matrix field using the "Cards" view mode to an entry type used in a Matrix field using the "As inline-editable blocks" view mode
  2. Add the inline-editable Matrix field to a global set
  3. While editing the global set, create a new entry in the outer, inline-editable Matrix field. Then, create a new entry in the inner, "Cards" Matrix field in the nested entry that was just created

Expected behavior

Actual behavior

Craft CMS version

5.2.0-beta.3

PHP version

8.2.18

Operating system and version

DDEV v1.23.1

Database type and version

10.11.6-MariaDB (also tested on MySQL 8)

Image driver and version

No response

Installed plugins and versions

None

Thanks! I couldn’t reproduce this one but the bug was pretty obvious from the stack trace, so should be fixed for the next release.

Craft 5.2.0-beta.4 is out with that fix.