mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
fix msg property access for CSV legacy mode
This commit is contained in:
parent
407f9e3537
commit
5951632693
@ -153,7 +153,7 @@ module.exports = function(RED) {
|
||||
var tt = template[t];
|
||||
if (template[t].indexOf('"') >=0 ) { tt = "'"+tt+"'"; }
|
||||
else { tt = '"'+tt+'"'; }
|
||||
var p = RED.util.getMessageProperty(msg, node.property + '["'+s+'"]['+tt+']');
|
||||
var p = RED.util.getMessageProperty(inputData[s] || {}, tt);
|
||||
/* istanbul ignore else */
|
||||
if (p === undefined) { p = ""; }
|
||||
// fix to honour include null values flag
|
||||
@ -287,13 +287,13 @@ module.exports = function(RED) {
|
||||
}
|
||||
|
||||
if (node.multi !== "one") {
|
||||
inputData = a;
|
||||
RED.util.setMessageProperty(msg, node.propertyOut, a);
|
||||
if (has_parts && nocr <= 1) {
|
||||
if (JSON.stringify(o) !== "{}") {
|
||||
node.store.push(o);
|
||||
}
|
||||
if (msg.parts.index + 1 === msg.parts.count) {
|
||||
inputData = node.store;
|
||||
RED.util.setMessageProperty(msg, node.propertyOut, node.store);
|
||||
msg.columns = template.map(v => v.indexOf(',')!==-1 ? '"'+v+'"' : v).filter(v => v).join(',');
|
||||
delete msg.parts;
|
||||
send(msg);
|
||||
|
Loading…
x
Reference in New Issue
Block a user