Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
as part of tree/note load make sure also relation targets are loaded, closes #1273
zadam8f018cc7c692
diff --git a/src/routes/api/tree.js b/src/routes/api/tree.jsindex 3a775792fc..57e1ad915f 100644--- a/src/routes/api/tree.js+++ b/src/routes/api/tree.js@@ -71,8 +71,17 @@ function getTree(req) {JOIN treeWithDescendantsAndAscendants ON branches.noteId = treeWithDescendantsAndAscendants.noteIdWHERE branches.isDeleted = 0AND branches.parentNoteId != ?+ ),+ treeWithDescendantsAscendantsAndTemplates AS (+ SELECT noteId FROM treeWithDescendantsAndAscendants+ UNION+ SELECT attributes.value FROM attributes+ JOIN treeWithDescendantsAscendantsAndTemplates ON attributes.noteId = treeWithDescendantsAscendantsAndTemplates.noteId+ WHERE attributes.isDeleted = 0+ AND attributes.type = 'relation'+ AND attributes.name = 'template')- SELECT noteId FROM treeWithDescendantsAndAscendants`, [subTreeNoteId, subTreeNoteId]);+ SELECT noteId FROM treeWithDescendantsAscendantsAndTemplates`, [subTreeNoteId, subTreeNoteId]);noteIds.push(subTreeNoteId);