Merge pull request #3445 from node-red-hitachi/fix-path-substitution

Fix substitution of NR_NODE_PATH
This commit is contained in:
Nick O'Leary
2022-02-15 11:26:19 +00:00
committed by GitHub
2 changed files with 142 additions and 5 deletions

View File

@@ -77,15 +77,16 @@ function createNode(flow,config) {
if (typeof nodeTypeConstructor === "function") {
var conf = clone(config);
delete conf.credentials;
for (var p in conf) {
if (conf.hasOwnProperty(p)) {
mapEnvVarProperties(conf,p,flow,conf);
}
}
try {
Object.defineProperty(conf,'_module', {value: typeRegistry.getNodeInfo(type), enumerable: false, writable: true })
Object.defineProperty(conf,'_flow', {value: flow, enumerable: false, writable: true })
Object.defineProperty(conf,'_path', {value: `${flow.path}/${config._alias||config.id}`, enumerable: false, writable: true })
for (var p in conf) {
if (conf.hasOwnProperty(p)) {
mapEnvVarProperties(conf,p,flow,conf);
}
}
newNode = new nodeTypeConstructor(conf);
} catch (err) {
Log.log({