Skip to content

Commit

Permalink
Merge pull request #4457 from node-red/4456-fix-group-in-subflow-lookup
Browse files Browse the repository at this point in the history
Ensure subflow instances keep track of their groups
  • Loading branch information
knolleary committed Nov 29, 2023
2 parents 3e2d20e + fb54c05 commit 2dfabb5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/node_modules/@node-red/runtime/lib/flows/Subflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,20 @@ class Subflow extends Flow {
id: subflowInstance.id,
configs: {},
nodes: {},
groups: {},
subflows: {}
}

if (subflowDef.groups) {
// Clone all of the subflow group definitions and give them new IDs
for (i in subflowDef.groups) {
if (subflowDef.groups.hasOwnProperty(i)) {
node = createNodeInSubflow(subflowInstance.id,subflowDef.groups[i]);
node_map[node._alias] = node;
subflowInternalFlowConfig.groups[node.id] = node;
}
}
}
if (subflowDef.configs) {
// Clone all of the subflow config node definitions and give them new IDs
for (i in subflowDef.configs) {
Expand Down

0 comments on commit 2dfabb5

Please sign in to comment.