Skip to content

remember the invalid nested element ids too#18690

Merged
brandonkelly merged 3 commits into5.xfrom
bugfix/applying-draft-and-invalid-nested-element-ids
Apr 14, 2026
Merged

remember the invalid nested element ids too#18690
brandonkelly merged 3 commits into5.xfrom
bugfix/applying-draft-and-invalid-nested-element-ids

Conversation

@i-just
Copy link
Copy Markdown
Contributor

@i-just i-just commented Apr 13, 2026

Description

When the draft couldn’t be applied, we still save it, so that we don’t lose any content, and we “remember” the validation errors from before the draft was saved.

This PR ensures that the invalid nested element IDs are also “remembered”. This ensures that, e.g. the relevant nested element can be visually marked as invalid.

Steps to reproduce:

  1. clean 5.9.19 installation
  2. create a matrix field with an entry type containing title and plain text fields; all default settings
  3. create a section with an entry type that contains that matrix field
  4. create an entry in that section, add a nested entry into the matrix field, but leave the plain text field empty; fully save it all
  5. edit the entry type for the matrix field and make the plain text field required
  6. edit the entry from step 4 but in a slideout (e.g. double-click or use the action from the element index page)
  7. press save to try to fully save it - you should see a validation error about the nested entry

Before this PR: the relevant card didn’t have the indicators showing that it’s invalid (red title and an exclamation mark icon).

After this PR: the indicators are there

Related issues

n/a

@brandonkelly brandonkelly merged commit 656f9da into 5.x Apr 14, 2026
2 checks passed
@brandonkelly brandonkelly deleted the bugfix/applying-draft-and-invalid-nested-element-ids branch April 14, 2026 14:18
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.

2 participants