mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 11:26:15 +01:00
fixed bug in search where note with inherited attribute is not matched when the owning note is not matched, #2457
This commit is contained in:
@@ -23,20 +23,18 @@ class AttributeExistsExp extends Expression {
|
||||
for (const attr of attrs) {
|
||||
const note = attr.note;
|
||||
|
||||
if (inputNoteSet.hasNoteId(note.noteId)) {
|
||||
if (attr.isInheritable) {
|
||||
resultNoteSet.addAll(note.getSubtreeNotesIncludingTemplated());
|
||||
}
|
||||
else if (note.isTemplate()) {
|
||||
resultNoteSet.addAll(note.getTemplatedNotes());
|
||||
}
|
||||
else {
|
||||
resultNoteSet.add(note);
|
||||
}
|
||||
if (attr.isInheritable) {
|
||||
resultNoteSet.addAll(note.getSubtreeNotesIncludingTemplated());
|
||||
}
|
||||
else if (note.isTemplate()) {
|
||||
resultNoteSet.addAll(note.getTemplatedNotes());
|
||||
}
|
||||
else {
|
||||
resultNoteSet.add(note);
|
||||
}
|
||||
}
|
||||
|
||||
return resultNoteSet;
|
||||
return resultNoteSet.intersection(inputNoteSet);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user