Skip to content

Nested Matrix with same field handle share same limitations. #1000

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

Closed
xhuang9 opened this issue May 22, 2025 · 2 comments
Closed

Nested Matrix with same field handle share same limitations. #1000

xhuang9 opened this issue May 22, 2025 · 2 comments

Comments

@xhuang9
Copy link

xhuang9 commented May 22, 2025

Bug Description

When saving an entry with field
Body (neo)
-> Cards Limit 2 (matrix)
-> Cards A (matrix set maximum 2)
-> Cards Limit 3 (matrix)
-> Cards B (matrix set maximum 3)

If "Cards A" and "Cards B" have the same handle e.g. cards.
They then share a same javascript validation, and can't be saving correctly.

Maybe not relavant, but when Cards A, Cards B matrix itself contains conditional fields. Then the save will be successful, but the matrix

Can't reproduce it with just matrix View Mode "As inline-editable blocks"

Image

Steps to reproduce

  • Spin up a new craft 5, copy in project config, composer.json, install database and log into CP.
  • Create a new entry.
  • In Neo field, add Article, then add Cards limit 2 with 2 child matrix cards
  • Then In Neo field, and Article, then add Cards limit 3 with 3 child matrix cards
  • And save

Her is a project config, hopefully you can use to spin up a new craft and reproduce it.
project.zip
composer.json

Expected behaviour

You will see that all cards in Cards Limit 3 will be removed and entry warn you with validation error.

Image

Neo version

5.4.3

Craft CMS version

5.7.7 or 5.7.6

What is the affected Neo field's propagation method?

No response

Does this issue involve templating, and if so, is eager-loading used?

This is not a templating issue

@ttempleton
Copy link
Contributor

Thanks for reporting that, and for providing the files! Fixed now for the next release. In the meantime, you can get the fix by setting your composer.json file's spicyweb/craft-neo requirement to 5.x-dev as 5.4.3 and running composer update.

@ttempleton
Copy link
Contributor

Just released Neo 5.4.4 including the fix for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants