Skip to content

Commit 656f9da

Browse files
authored
Merge pull request #18690 from craftcms/bugfix/applying-draft-and-invalid-nested-element-ids
remember the invalid nested element ids too
2 parents 5e65f84 + 83d2d40 commit 656f9da

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Release Notes for Craft CMS 5
22

3+
## Unreleased
4+
5+
- Fixed a bug where nested element cards weren’t showing validation errors. ([#18690](https://github.com/craftcms/cms/pull/18690))
6+
37
## 5.9.19 - 2026-04-07
48

59
- Most classes can now be instantiated via the `create()` Twig function. ([#18376](https://github.com/craftcms/cms/discussions/18376))

src/controllers/ElementsController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2190,10 +2190,12 @@ public function actionApplyDraft(): ?Response
21902190
// save the draft anyway, so we don’t lose the latest changes
21912191
// (see https://github.com/craftcms/cms/issues/18657)
21922192
$errors = $element->getErrors();
2193+
$invalidNestedElementIds = $element->getInvalidNestedElementIds();
21932194
$element->setScenario(Element::SCENARIO_ESSENTIALS);
21942195
$elementsService->saveElement($element, saveContent: $saveContent);
21952196
$element->clearErrors();
21962197
$element->addErrors($errors);
2198+
$element->addInvalidNestedElementIds($invalidNestedElementIds);
21972199

21982200
return $this->_asAppyDraftFailure($element);
21992201
}

0 commit comments

Comments
 (0)