This question comes up as a result of another thread where a ui-button
sent a msg to a ui-text
node and the ui-text
node had the label set to {{msg.topic}}
. The problem was that the topic in the ui-button
was left empty. This causes a problem in the ui-text
node when it tries to evaluate the label since there is no msg.topic in the object.
The problem (as I see it) is because of the logic setting msg.topic.
ui-form
has no input option so the code in ui-form.js (line 31) that sets msg.topic is:
msg.topic = config.topic;
Which works fine. The other nodes with this issue all use this code to set msg.topic:
msg.topic = config.topic || msg.topic;
However if config.topic is empty AND msg.topic is empty, then neither case is TRUE so msg.topic is not set. This can be corrected by changing that line to:
msg.topic = config.topic || msg.topic || "";
and an empty msg.topic will be build in the outgoing msg.
The following are the nodes that need(?) this fix:
ui_button.js - line: 54
ui_colour_picker.js - line: 46
ui_date_picker.js - line: 41
ui_dropdown.js - line: 127
ui_numeric.js - line: 39
ui_slider.js - line: 36
ui_switch.js - line: 123
ui_text_input.js - line: 37
I will attempt a PR if given the go ahead