Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template Node sticks with first Template it receives, ignoring subsequent ones #1671

Closed
5 tasks
abender opened this issue Mar 14, 2018 · 0 comments
Closed
5 tasks

Comments

@abender
Copy link

abender commented Mar 14, 2018

What are the steps to reproduce?

Create a Flow with

  • One Template Node, that has no default Template but uses msg.template.
  • 2 Function Nodes, one will set 'msg.template = "Foo"', the other one 'msg.template = "Bar"'
  • Connect the Function Nodes with the Template Nodes Input
  • Connect the output of Template Node with a new Debug Node
  • Connect a new Inject Node with the input of both Function nodes
  • Execute

What happens?

In the Debug Log we can read "Foo", "Foo".

What do you expect to happen?

The Debug Log should read "Foo", "Bar".

Please tell us about your environment:

  • Node-RED version: 0.18.4
  • node.js version: 9.8.0
  • npm version: 5.6.0
  • Platform/OS: Ubuntu 16.04 LTS
  • Browser: Chrome 65

I think the Error is this line: https://github.com/node-red/node-red/blob/master/nodes/core/core/80-template.js#L91 where a new Template only is used if there is none so far. The node should always use the msg.template if it is present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants