From a7a949377ba314028895c9de5c5a08568993e108 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Thu, 4 Jun 2020 17:06:11 +0100 Subject: [PATCH] Ensure configNode.users is updated properly on import --- .../node_modules/@node-red/editor-client/src/js/nodes.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/nodes.js b/packages/node_modules/@node-red/editor-client/src/js/nodes.js index 887ec062f..67d3aa616 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/nodes.js +++ b/packages/node_modules/@node-red/editor-client/src/js/nodes.js @@ -1354,9 +1354,9 @@ RED.nodes = (function() { for (var d3 in n._def.defaults) { if (n._def.defaults.hasOwnProperty(d3)) { if (n._def.defaults[d3].type && node_map[n[d3]]) { - n[d3] = node_map[n[d3]].id; - configNode = RED.nodes.node(n[d3]); - if (configNode && configNode.users.indexOf(n) === -1) { + configNode = node_map[n[d3]]; + n[d3] = configNode.id; + if (configNode.users.indexOf(n) === -1) { configNode.users.push(n); } } else if (nodeTypeArrayReferences.hasOwnProperty(n.type) && nodeTypeArrayReferences[n.type] === d3 && n[d3] !== undefined && n[d3] !== null) {