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

deleting nested inline editable matrix blocks and updating field layout #16560

Conversation

i-just
Copy link
Contributor

@i-just i-just commented Jan 28, 2025

Description

Steps to reproduce:

  • create a matrix field (innerMatrix) with at least one field in it; view mode: inline-editable blocks;
  • create a second matrix field (outerMatrix) that contains the innerMatrix field; view mode: inline-editable blocks;
  • create a section with an entry type that contains the outerMatrix field
  • create an entry in that section (it can be fully saved)
  • edit that entry and add at least one outerMatrix entry; in that entry create at least one innerMatrix entry
  • delete the outerMatrix entry
  • observe a 400 error from the elements/update-field-layout action about the element id being invalid

This happens because the entries are marked as deleted but their UIDs are passed to the elements/update-field-layout action. Since they’re already deleted, they cannot be found and the error is triggered.

Solution:
As a last resort, check for trashed elements (by uid) too.

Related issues

#16540

@i-just i-just requested a review from brandonkelly January 28, 2025 15:40
@brandonkelly brandonkelly deleted the bugfix/16540-deleting-matrix-blocks-and-update-field-layout branch January 28, 2025 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant