mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
fix env var access using $env for groups
This commit is contained in:
@@ -439,8 +439,6 @@ class Flow {
|
||||
}
|
||||
}
|
||||
return [env.name, env];
|
||||
|
||||
return [env.name, env];
|
||||
});
|
||||
group._env = Object.fromEntries(entries);
|
||||
}
|
||||
@@ -457,24 +455,24 @@ class Flow {
|
||||
const val
|
||||
= ((value === "true") ||
|
||||
(value === true));
|
||||
return {
|
||||
return [{
|
||||
val: val
|
||||
};
|
||||
}, null];
|
||||
}
|
||||
if (type === "cred") {
|
||||
return {
|
||||
return [{
|
||||
val: value
|
||||
};
|
||||
}, null];
|
||||
}
|
||||
try {
|
||||
var val = redUtil.evaluateNodeProperty(value, type, node, null, null);
|
||||
return {
|
||||
return [{
|
||||
val: val
|
||||
};
|
||||
}, null];
|
||||
}
|
||||
catch (e) {
|
||||
this.error(e);
|
||||
return null;
|
||||
return [null, null];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -488,7 +486,7 @@ class Flow {
|
||||
return this.getGroupEnvSetting(node, parent, name);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return [null, name];
|
||||
}
|
||||
|
||||
|
||||
@@ -545,6 +543,9 @@ class Flow {
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
key = key.substring(8);
|
||||
}
|
||||
}
|
||||
return this.parent.getSetting(key);
|
||||
}
|
||||
|
@@ -373,10 +373,11 @@ class Subflow extends Flow {
|
||||
const node = this.subflowInstance;
|
||||
if (node.g) {
|
||||
const group = this.getGroupNode(node.g);
|
||||
const result = this.getGroupEnvSetting(node, group, name);
|
||||
const [result, newName] = this.getGroupEnvSetting(node, group, name);
|
||||
if (result) {
|
||||
return result.val;
|
||||
}
|
||||
name = newName;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user