Merge pull request #5296 from node-red/5242-fix-subflow-quickadd

Handle subflow virtual port nodes when generating quick-add context
This commit is contained in:
Nick O'Leary
2025-10-09 14:10:14 +01:00
committed by GitHub
2 changed files with 9 additions and 2 deletions

View File

@@ -1627,7 +1627,9 @@ RED.nodes = (function() {
if (node.type === "group") {
nns = nns.concat(createExportableNodeSet(node.nodes, { exportedIds, exportedSubflows, exportedConfigNodes }));
}
} else {
} else if (!node.direction) {
// node.direction indicates its a virtual subflow node (input/output/status) that cannot be
// exported so should be skipped over.
var convertedSubflow = convertSubflow(node, { credentials: false });
nns.push(convertedSubflow);
}

View File

@@ -1418,7 +1418,12 @@ RED.view = (function() {
if (quickAddLink?.virtualLink) {
context.virtualLink = true;
}
context.flow = RED.nodes.createExportableNodeSet(RED.nodes.getAllFlowNodes(quickAddLink.node))
if (quickAddLink.node?.type === 'subflow') {
// This is a subflow 'virtual' port node.
context.flow = []
} else {
context.flow = RED.nodes.createExportableNodeSet(RED.nodes.getAllFlowNodes(quickAddLink.node))
}
}
// console.log(context)