diff --git a/src/base/NestedElementTrait.php b/src/base/NestedElementTrait.php index f0a7856ca48..e6907b577fd 100644 --- a/src/base/NestedElementTrait.php +++ b/src/base/NestedElementTrait.php @@ -154,8 +154,9 @@ public function getPrimaryOwner(): ?ElementInterface return null; } - $this->_primaryOwner = Craft::$app->getElements()->getElementById($primaryOwnerId, null, $this->siteId, [ + $this->_primaryOwner = Craft::$app->getElements()->getElementById($primaryOwnerId, null, null, [ 'trashed' => null, + 'preferSites' => [$this->siteId], ]) ?? false; if (!$this->_primaryOwner) { throw new InvalidConfigException("Invalid owner ID: $primaryOwnerId");