Skip to content

Commit

Permalink
Merge pull request craftcms#12229 from craftcms/bugfix/cms-12228-cano…
Browse files Browse the repository at this point in the history
…nical-id

Handle cases where `Element->_canonical` is false
  • Loading branch information
brandonkelly authored Oct 31, 2022
2 parents 93a3196 + 7b6e78f commit 3d919c0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

- Fixed asset indexing for Local filesystems that were configured to use a symlinked server path.
- Fixed an error that could occur when calling `craft\base\Element::getCanonicalUid()` on a draft loaded for a site that the canonical element didn’t exist on yet. ([#12228](https://github.com/craftcms/cms/issues/12228))

## 4.3.1 - 2022-10-27

Expand Down
2 changes: 1 addition & 1 deletion src/base/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -2582,7 +2582,7 @@ public function getCanonicalUid(): ?string
}

// If the canonical element is already memoized via getCanonical(), go with its UUID
if (isset($this->_canonical)) {
if (isset($this->_canonical) && $this->_canonical) {
return $this->_canonical->uid;
}

Expand Down

0 comments on commit 3d919c0

Please sign in to comment.