mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Fix link call node can call out of a subflow
This commit is contained in:
parent
a3c5b75368
commit
16c49306f3
@ -2408,7 +2408,7 @@ RED.nodes = (function() {
|
|||||||
}
|
}
|
||||||
// If importing a link node, ensure both ends of each link are either:
|
// If importing a link node, ensure both ends of each link are either:
|
||||||
// - not in a subflow
|
// - 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) {
|
if (/^link /.test(n.type) && n.links) {
|
||||||
n.links = n.links.filter(function(id) {
|
n.links = n.links.filter(function(id) {
|
||||||
const otherNode = node_map[id] || RED.nodes.node(id);
|
const otherNode = node_map[id] || RED.nodes.node(id);
|
||||||
@ -2419,6 +2419,9 @@ RED.nodes = (function() {
|
|||||||
if (otherNode.z === n.z) {
|
if (otherNode.z === n.z) {
|
||||||
// Both ends in the same flow/subflow
|
// Both ends in the same flow/subflow
|
||||||
return true
|
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)) {
|
} else if (!!getSubflow(n.z) || !!getSubflow(otherNode.z)) {
|
||||||
// One end is in a subflow - remove the link
|
// One end is in a subflow - remove the link
|
||||||
return false
|
return false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user