From 6ba3e5ab7f866ac93ecbb48883dabf61723cde98 Mon Sep 17 00:00:00 2001 From: zadam Date: Mon, 2 Dec 2019 23:07:19 +0100 Subject: [PATCH] backport fix from master to avoid doubled attributes inherited from multiple paths --- src/entities/note.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/entities/note.js b/src/entities/note.js index d6506bf50..335015339 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);