From 9d7b8f1f2f38cc09c50d1b266aced9117df8ab23 Mon Sep 17 00:00:00 2001 From: Steve-Mcl Date: Thu, 20 May 2021 22:35:42 +0100 Subject: [PATCH] change user prop name for injected values - less chance for collision --- .../@node-red/nodes/core/common/20-inject.html | 2 +- .../node_modules/@node-red/nodes/core/common/20-inject.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/node_modules/@node-red/nodes/core/common/20-inject.html b/packages/node_modules/@node-red/nodes/core/common/20-inject.html index c3136ef61..a7957874a 100644 --- a/packages/node_modules/@node-red/nodes/core/common/20-inject.html +++ b/packages/node_modules/@node-red/nodes/core/common/20-inject.html @@ -750,7 +750,7 @@ var items = $('#node-inject-custom-list').editableList('items'); var result = getProps(items); if (result && result.props && result.props.length) { - m = { __customProps: result.props }; + m = { __user_inject_props__: result.props }; } doInject(m); //RED.tray.close(); diff --git a/packages/node_modules/@node-red/nodes/core/common/20-inject.js b/packages/node_modules/@node-red/nodes/core/common/20-inject.js index 732fbd856..26be74bfa 100644 --- a/packages/node_modules/@node-red/nodes/core/common/20-inject.js +++ b/packages/node_modules/@node-red/nodes/core/common/20-inject.js @@ -101,10 +101,10 @@ module.exports = function(RED) { this.on("input", function(msg, send, done) { var errors = []; var props = this.props; - if(msg.__customProps && Array.isArray(msg.__customProps)) { - props = msg.__customProps; + if(msg.__user_inject_props__ && Array.isArray(msg.__user_inject_props__)) { + props = msg.__user_inject_props__; } - delete msg.__customProps; + delete msg.__user_inject_props__; props.forEach(p => { var property = p.p; var value = p.v ? p.v : ''; @@ -160,7 +160,7 @@ module.exports = function(RED) { var node = RED.nodes.getNode(req.params.id); if (node != null) { try { - if (req.body && req.body.__customProps) { + if (req.body && req.body.__user_inject_props__) { node.receive(req.body); } else { node.receive();