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.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 #15160

Closed
mmikkel opened this issue Jun 6, 2024 · 2 comments
Labels

Comments

@mmikkel
Copy link
Contributor

mmikkel commented Jun 6, 2024

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

@mmikkel mmikkel added the bug label Jun 6, 2024
brandonkelly added a commit that referenced this issue Jun 6, 2024
@brandonkelly
Copy link
Member

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.

@brandonkelly
Copy link
Member

brandonkelly commented Jun 7, 2024

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

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

2 participants