diff --git a/application/Espo/Services/RecordTree.php b/application/Espo/Services/RecordTree.php index 8a9b2d096f..78584f3925 100644 --- a/application/Espo/Services/RecordTree.php +++ b/application/Espo/Services/RecordTree.php @@ -62,6 +62,18 @@ class RecordTree extends Record if (!$this->subjectEntityType) { $this->subjectEntityType = substr($this->entityType, 0, strlen($this->entityType) - 8); } + + if ($this->entityType === 'RecordTree') { + $this->entityType = null; + $this->subjectEntityType = null; + } + } + + public function setEntityType(string $entityType): void + { + parent::setEntityType($entityType); + + $this->subjectEntityType = substr($this->entityType, 0, strlen($this->entityType) - 8); } public function getTree(