diff --git a/red/nodes/index.js b/red/nodes/index.js index b29a8a7fb..72fe265f5 100644 --- a/red/nodes/index.js +++ b/red/nodes/index.js @@ -129,7 +129,7 @@ module.exports = { getNodeConfig: registry.getNodeConfig, clearRegistry: registry.clear, - cleanNodeList: registry.cleanNodeList, + cleanModuleList: registry.cleanModuleList, // Flow handling loadFlows: flows.load, diff --git a/red/nodes/registry.js b/red/nodes/registry.js index 4aefb39f3..e2e1eb6a0 100644 --- a/red/nodes/registry.js +++ b/red/nodes/registry.js @@ -372,13 +372,18 @@ var registry = (function() { saveNodeList: saveNodeList, - cleanNodeList: function() { + cleanModuleList: function() { var removed = false; for (var mod in moduleConfigs) { if (moduleConfigs.hasOwnProperty(mod)) { if (moduleConfigs[mod] && !moduleNodes[mod]) { - registry.removeNode(id); - removed = true; + var nodes = moduleConfigs[mod].nodes; + for (var node in nodes) { + if (nodes.hasOwnProperty(node)) { + registry.removeNode(mod+"/"+node); + removed = true; + } + } } } } @@ -775,5 +780,5 @@ module.exports = { addModule: addModule, removeModule: registry.removeModule, - cleanNodeList: registry.cleanNodeList + cleanModuleList: registry.cleanModuleList }; diff --git a/red/server.js b/red/server.js index 71fd21b76..3952ff71e 100644 --- a/red/server.js +++ b/red/server.js @@ -91,7 +91,7 @@ function start() { } if (!settings.autoInstallModules) { util.log("[red] Removing modules from config"); - redNodes.cleanNodeList(); + redNodes.cleanModuleList(); } } defer.resolve();