mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 09:58:32 +02:00
as part of tree/note load make sure also relation targets are loaded, closes #1273
This commit is contained in:
parent
4a470ff9e5
commit
8f018cc7c6
@ -71,8 +71,17 @@ function getTree(req) {
|
|||||||
JOIN treeWithDescendantsAndAscendants ON branches.noteId = treeWithDescendantsAndAscendants.noteId
|
JOIN treeWithDescendantsAndAscendants ON branches.noteId = treeWithDescendantsAndAscendants.noteId
|
||||||
WHERE branches.isDeleted = 0
|
WHERE branches.isDeleted = 0
|
||||||
AND branches.parentNoteId != ?
|
AND 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);
|
noteIds.push(subTreeNoteId);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user