diff --git a/src/foreignField/ForeignFieldModel.php b/src/foreignField/ForeignFieldModel.php index 3f20852..aa41190 100644 --- a/src/foreignField/ForeignFieldModel.php +++ b/src/foreignField/ForeignFieldModel.php @@ -67,13 +67,13 @@ public function getOwner() { * @return ElementInterface|null */ public function getRoot() { - if (!isset($this->_rootElement)) { - $this->_rootElement = is_null($this->_owner) + if (!isset($this->_root)) { + $this->_root = is_null($this->_owner) ? null : $this->getParentElement($this->_owner); } - return $this->_rootElement; + return $this->_root; } /**