Bug fixes with same id at plugins

This commit is contained in:
Luis Fernando Molina committed 2021-10-01 15:51:00 +02:00
1 parent bb2055dcf4
commit bc7a931bd0
4 files changed
+6 -4

No files matched your search

@@ -164,6 +164,7 @@ function newFoundationsFunctionLibraryUiObjectsFromNodes() {
if (err && err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
console.log('[WARN] Cannot load plugin ' + pluginFolder + ' ' + name + '. The Workspace will be loaded with this plugin file missing.')
} else {
let receivedNode
try {
@@ -174,6 +175,7 @@ function newFoundationsFunctionLibraryUiObjectsFromNodes() {
console.log('[ERROR] pluginAllTheseFiles -> err.stack = ' + err.stack)
return
}
/*
If the workspace already contains a root node with the id of the head of the hirierchy
we are loading, we remove it because the plugin file has precedende.
@@ -181,6 +183,7 @@ function newFoundationsFunctionLibraryUiObjectsFromNodes() {
for (let i = 0; i < node.rootNodes.length; i++) {
let rootNode = node.rootNodes[i]
if (rootNode.id === receivedNode.id) {
console.log('[WARN] The node with name "' + rootNode.name + '" and type "' + rootNode.type + '" will be replaced by the node with name "' + receivedNode.name + '" and type "' + receivedNode.type +'" because they both have the same node.id')
node.rootNodes.splice(i, 1)
break
}
@@ -365,7 +368,6 @@ function newFoundationsFunctionLibraryUiObjectsFromNodes() {
if (node[property.name] !== undefined) {
if (node[property.name].name === pathName && node[property.name].type === pathType) {
nextNode = node[property.name]
console.log("we have a match!", nextNode)
return nextNode
}
}
@@ -36,7 +36,7 @@
}
],
"assets": [],
"id": "79467868-de64-42a9-8852-8c1377bbd52b",
"id": "79467863-de64-42a9-8852-8c1377bbd52b",
"savedPayload": {
"position": {
"x": 2810.75,
@@ -36,7 +36,7 @@
}
],
"assets": [],
"id": "5ea11d1d-31e4-4e77-9697-cf373ab0c1e3",
"id": "5ea11d1d-31e4-4e77-9297-cf373ab0c1e3",
"savedPayload": {
"position": {
"x": 2896.75,
@@ -311,7 +311,7 @@
}
],
"positions": [],
"id": "50c68665-5da2-48a8-b229-7a1563ae82d2",
"id": "50c68665-5da2-48a4-b229-7a1563ae82d2",
"savedPayload": {
"position": {
"x": 30231,