From bd13d45207b6ecc674b3a461768034c06a911edf Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Sun, 2 Feb 2025 13:59:05 +0200 Subject: [PATCH] fix record tree entity removal when no real subject used --- application/Espo/Services/RecordTree.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/application/Espo/Services/RecordTree.php b/application/Espo/Services/RecordTree.php index cd74b1c63f..5ce2b89b26 100644 --- a/application/Espo/Services/RecordTree.php +++ b/application/Espo/Services/RecordTree.php @@ -175,6 +175,11 @@ class RecordTree extends Record { $entityType = $this->getSubjectEntityType(); + // If used without an actual subject entity. + if (!$this->entityManager->hasRepository($entityType)) { + return true; + } + $query = $this->selectBuilderFactory ->create() ->from($entityType)