From 0c6799c9368f41c38f2effceb29423e62b1693d2 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sat, 21 Apr 2012 20:37:06 +0100 Subject: modulemanager: When a shared module becomes global, ensure it still gets loaded onto the original target host --- core/modulemanager.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'core/modulemanager.lua') diff --git a/core/modulemanager.lua b/core/modulemanager.lua index e76f2624..f263816b 100644 --- a/core/modulemanager.lua +++ b/core/modulemanager.lua @@ -183,8 +183,10 @@ local function do_load_module(host, module_name) log("warn", "mod_%s: Setting module.host = '*' deprecated, call module:set_global() instead", module_name); api_instance:set_global(); end - else - modulemap[host][module_name] = pluginenv; + if host ~= api_instance.host and module_has_method(pluginenv, "add_host") then + -- Now load the module again onto the host it was originally being loaded on + do_load_module(host, module_name); + end end end if not ok then -- cgit v1.2.3