Skip to content

Build your personal knowledge base with Trilium Notes

backport fix from master to avoid doubled attributes inherited from multiple paths

zadam6ba3e5ab7f86
diff --git a/src/entities/note.js b/src/entities/note.js
index d6506bf50c..3350153395 100644
--- a/src/entities/note.js
+++ b/src/entities/note.js
@@ -334,6 +334,11 @@ class Note extends Entity {
// we order by noteId so that attributes from same note stay together. Actual noteId ordering doesn't matter.
const filteredAttributes = attributes.filter((attr, index) => {
+ // if this exact attribute already appears then don't include it (can happen via cloning)
+ if (attributes.findIndex(it => it.attributeId === attr.attributeId) !== index) {
+ return false;
+ }
+
if (attr.isDefinition()) {
const firstDefinitionIndex = attributes.findIndex(el => el.type === attr.type && el.name === attr.name);