Skip to content

Commit

Permalink
Merge pull request #16136 from craftcms/bugfix/nested-entries-and-own…
Browse files Browse the repository at this point in the history
…ers-new-site

Editing owner entry when it's new for site (and still a provisional draft)
  • Loading branch information
brandonkelly authored Nov 18, 2024
2 parents 0dd4080 + 1116217 commit 628ebc5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/base/NestedElementTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 628ebc5

Please sign in to comment.