1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Fix change node, not handling from field properly when using context

This commit is contained in:
Franck Mourre 2022-07-11 10:51:31 +02:00
parent e14dd06a94
commit 7a048d5b32

View File

@ -168,9 +168,9 @@ module.exports = function(RED) {
return getFromValueType(RED.util.getMessageProperty(msg,rule.from),done); return getFromValueType(RED.util.getMessageProperty(msg,rule.from),done);
} else if (rule.fromt === 'flow' || rule.fromt === 'global') { } else if (rule.fromt === 'flow' || rule.fromt === 'global') {
var contextKey = RED.util.parseContextStore(rule.from); var contextKey = RED.util.parseContextStore(rule.from);
if (/\[msg\./.test(context.key)) { if (/\[msg\./.test(contextKey.key)) {
// The key has a nest msg. reference to evaluate first // The key has a nest msg. reference to evaluate first
context.key = RED.util.normalisePropertyExpression(contextKey.key,msg,true); contextKey.key = RED.util.normalisePropertyExpression(contextKey.key,msg,true);
} }
node.context()[rule.fromt].get(contextKey.key, contextKey.store, (err,fromValue) => { node.context()[rule.fromt].get(contextKey.key, contextKey.store, (err,fromValue) => {
if (err) { if (err) {