Skip to content

Commit

Permalink
Fixed #16659
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Feb 11, 2025
1 parent 7e95638 commit f0fee32
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Fixed a bug where user addresses weren’t getting restored when soft-deleted users were restored. ([#16636](https://github.com/craftcms/cms/pull/16636))
- Fixed a bug where pressing the “New entry” button multiple times quickly would create multiple nested entries, circumventing the “Max Entries” settings. ([#16642](https://github.com/craftcms/cms/issues/16642))
- Fixed a bug where Link fields without values were always getting marked as dirty when making another change to the element. ([#16649](https://github.com/craftcms/cms/pull/16649))
- Fixed an error that could occur when programmatically duplicating a nested element for a new site. ([#16659](https://github.com/craftcms/cms/issues/16659))
- Fixed a potential phishing attack vector.
- Fixed a styling issue.

Expand Down
16 changes: 12 additions & 4 deletions src/base/NestedElementTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,26 @@ public static function eagerLoadingMap(array $sourceElements, string $handle): a
public bool $updateSearchIndexForOwner = false;

/**
* @var ElementInterface|false The primary owner element, or false if [[primaryOwnerId]] is invalid
* @var ElementInterface|false|null The primary owner element, or false if [[primaryOwnerId]] is invalid
* @see getPrimaryOwner()
* @see setPrimaryOwner()
*/
private ElementInterface|false $_primaryOwner;
private ElementInterface|false|null $_primaryOwner = null;

/**
* @var ElementInterface|false The owner element, or false if [[ownerId]] is invalid
* @var ElementInterface|false|null The owner element, or false if [[ownerId]] is invalid
* @see getOwner()
* @see setOwner()
*/
private ElementInterface|false $_owner;
private ElementInterface|false|null $_owner = null;

public function __clone(): void
{
parent::__clone();

$this->_primaryOwner = null;
$this->_owner = null;
}

/**
* @inheritdoc
Expand Down

0 comments on commit f0fee32

Please sign in to comment.