From 41a6e777ea6e4e3a2883e723258d6b90ac7c9c20 Mon Sep 17 00:00:00 2001 From: azivner Date: Tue, 14 Aug 2018 13:02:17 +0200 Subject: [PATCH] attributes coming from inheritAttributes are inherited only if the inheritAttributes relation itself is inheritable --- src/entities/note.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/entities/note.js b/src/entities/note.js index c75a9144f..592c47c34 100644 --- a/src/entities/note.js +++ b/src/entities/note.js @@ -102,10 +102,11 @@ class Note extends Entity { WHERE attributes.isDeleted = 0 AND attributes.type = 'relation' AND attributes.name = 'inheritAttributes' + AND (attributes.noteId = ? OR attributes.isInheritable = 1) ) SELECT attributes.* FROM attributes JOIN treeWithAttrs ON attributes.noteId = treeWithAttrs.noteId WHERE attributes.isDeleted = 0 AND (attributes.isInheritable = 1 OR attributes.noteId = ?) - ORDER BY level, noteId, position`, [this.noteId, this.noteId]); + ORDER BY level, noteId, position`, [this.noteId, this.noteId, this.noteId]); // attributes are ordered so that "closest" attributes are first // we order by noteId so that attributes from same note stay together. Actual noteId ordering doesn't matter.