From 16c49306f35b389961ad7513bb2db792ec434bf2 Mon Sep 17 00:00:00 2001 From: GogoVega <92022724+GogoVega@users.noreply.github.com> Date: Thu, 26 Sep 2024 19:01:44 +0200 Subject: [PATCH 1/2] Fix link call node can call out of a subflow --- .../node_modules/@node-red/editor-client/src/js/nodes.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 dacd6eeae..25e8c2185 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 @@ -2408,7 +2408,7 @@ RED.nodes = (function() { } // If importing a link node, ensure both ends of each link are either: // - not in a subflow - // - both in the same subflow + // - both in the same subflow (not for link call node) if (/^link /.test(n.type) && n.links) { n.links = n.links.filter(function(id) { const otherNode = node_map[id] || RED.nodes.node(id); @@ -2419,6 +2419,9 @@ RED.nodes = (function() { if (otherNode.z === n.z) { // Both ends in the same flow/subflow return true + } else if (n.type === "link call") { + // Link call node can call out of a subflow + return true } else if (!!getSubflow(n.z) || !!getSubflow(otherNode.z)) { // One end is in a subflow - remove the link return false From 3812ed5ed3cd7b51b074025ae8eacdda31e6762e Mon Sep 17 00:00:00 2001 From: GogoVega <92022724+GogoVega@users.noreply.github.com> Date: Mon, 7 Oct 2024 21:13:13 +0200 Subject: [PATCH 2/2] Link call node cannot call a link in a subflow Co-authored-by: Nick O'Leary --- .../node_modules/@node-red/editor-client/src/js/nodes.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 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 25e8c2185..857068d4b 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 @@ -2419,12 +2419,13 @@ RED.nodes = (function() { if (otherNode.z === n.z) { // Both ends in the same flow/subflow return true - } else if (n.type === "link call") { - // Link call node can call out of a subflow - return true + } else if (n.type === "link call" && !!getSubflow(otherNode.z)) { + // Link call node can call out of a subflow as long as otherNode is + // not in a subflow + return false } else if (!!getSubflow(n.z) || !!getSubflow(otherNode.z)) { // One end is in a subflow - remove the link - return false + return false } return true });