diff --git a/CHANGELOG.md b/CHANGELOG.md index 007201dd78e..28afe42c886 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Release Notes for Craft CMS 5 +## Unreleased + +- Fixed a bug where nested element cards weren’t showing validation errors. ([#18690](https://github.com/craftcms/cms/pull/18690)) + ## 5.9.19 - 2026-04-07 - Most classes can now be instantiated via the `create()` Twig function. ([#18376](https://github.com/craftcms/cms/discussions/18376)) diff --git a/src/controllers/ElementsController.php b/src/controllers/ElementsController.php index d3af6f792df..eb9f7b97279 100644 --- a/src/controllers/ElementsController.php +++ b/src/controllers/ElementsController.php @@ -2190,10 +2190,12 @@ public function actionApplyDraft(): ?Response // save the draft anyway, so we don’t lose the latest changes // (see https://github.com/craftcms/cms/issues/18657) $errors = $element->getErrors(); + $invalidNestedElementIds = $element->getInvalidNestedElementIds(); $element->setScenario(Element::SCENARIO_ESSENTIALS); $elementsService->saveElement($element, saveContent: $saveContent); $element->clearErrors(); $element->addErrors($errors); + $element->addInvalidNestedElementIds($invalidNestedElementIds); return $this->_asAppyDraftFailure($element); }