Skip to content

Fix merge behavior during validation for nested drawer forms#25965

Merged
AlexGaillard merged 6 commits intomainfrom
florian/cms-1375-cannot-save-nested-m2m-relation-edit-when-junction-table-has
Nov 17, 2025
Merged

Fix merge behavior during validation for nested drawer forms#25965
AlexGaillard merged 6 commits intomainfrom
florian/cms-1375-cannot-save-nested-m2m-relation-edit-when-junction-table-has

Conversation

@formfcw
Copy link
Contributor

@formfcw formfcw commented Oct 10, 2025

Scope

What's changed:

  • Fixed an issue where saving nested many-to-many relationships triggered a validation error due to incorrect merging behavior
  • Moved the redundant logic from the useItem() and useVersions() composables into a new mergeItemData utility, and also applied it to the overlay-item component

Potential Risks / Drawbacks

Tested Scenarios

  • Reproduction steps

Review Notes / Questions

Checklist

  • Added or updated tests
  • Documentation PR created here or not required

Fixes #25919

@linear
Copy link

linear bot commented Oct 10, 2025

@formfcw formfcw changed the title Fix nested validation bug Fix merge behavior during validation for nested drawer forms Nov 10, 2025
@formfcw formfcw marked this pull request as ready for review November 10, 2025 11:38
@robluton
Copy link
Contributor

@formfcw looks good! 🎸
Just a couple of minor comments.

@formfcw formfcw requested a review from robluton November 10, 2025 16:13
Copy link
Contributor

@robluton robluton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🎸

@formfcw formfcw requested a review from AlexGaillard November 17, 2025 09:33
@AlexGaillard AlexGaillard merged commit 7f761b2 into main Nov 17, 2025
68 checks passed
@AlexGaillard AlexGaillard deleted the florian/cms-1375-cannot-save-nested-m2m-relation-edit-when-junction-table-has branch November 17, 2025 13:25
@github-actions github-actions bot added this to the Next Release milestone Nov 17, 2025
AlexGaillard pushed a commit that referenced this pull request Nov 19, 2025
* use custom merge behavior in `validateForm` function

* refactor item data merging to its own utility function, and reuse it

* add tests

* add changeset

* update test descriptions
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot save nested M2M relation edit when junction table has newly added required field

3 participants