From bc047295cb58775301fcd710ee567a4a7a788f16 Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Sat, 16 Nov 2024 20:44:25 -0800 Subject: [PATCH] Set owner-is-canonical based on the primary owner See https://github.com/craftcms/cms/issues/15956#issuecomment-2474275593 --- CHANGELOG.md | 1 + src/helpers/Cp.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2710905b6e0..fbeb7d1796b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Fixed a bug where Link field query params weren’t working for elements that hadn’t been saved since updating to Craft 5.5.0+. ([#16113](https://github.com/craftcms/cms/issues/16113)) - Fixed a bug where Live Preview wasn’t reloading after reordering nested entries or addresses. ([#16122](https://github.com/craftcms/cms/issues/16122)) - Fixed a JavaScript error that could occur when reordering structured elements within an embedded element index. ([#16103](https://github.com/craftcms/cms/issues/16103)) +- Fixed a bug where changes to nested entries/addresses in card view were getting published immediately on save, if the parent element was a draft. ## 5.5.0.1 - 2024-11-13 diff --git a/src/helpers/Cp.php b/src/helpers/Cp.php index 82093b44849..88e13fdcd40 100644 --- a/src/helpers/Cp.php +++ b/src/helpers/Cp.php @@ -909,7 +909,7 @@ private static function baseElementAttributes(ElementInterface $element, array $ 'field-id' => $element instanceof NestedElementInterface ? $element->getField()?->id : null, 'primary-owner-id' => $element instanceof NestedElementInterface ? $element->getPrimaryOwnerId() : null, 'owner-id' => $element instanceof NestedElementInterface ? $element->getOwnerId() : null, - 'owner-is-canonical' => $element instanceof NestedElementInterface ? $element->getOwner()?->getIsCanonical() : null, + 'owner-is-canonical' => $element instanceof NestedElementInterface ? $element->getPrimaryOwner()?->getIsCanonical() : null, 'site-id' => $element->siteId, 'status' => $element->getStatus(), 'label' => (string)$element,