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

This commit is contained in:
zadam 2019-12-02 23:07:19 +01:00
parent f740e52ebf
commit 6ba3e5ab7f

View File

@ -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);