Module:Message box: Difference between revisions

Jump to navigation Jump to search
m>Mr. Stradivarius
on second thoughts, I like this way of passing params to category handler better
m>Mr. Stradivarius
fix bug where the arguments where all getting removed if cfg.allowBlankParams wasn't present
Line 156: Line 156:
     local newArgs = {}
     local newArgs = {}
     for k, v in pairs(args) do
     for k, v in pairs(args) do
         for i, param in ipairs(cfg.allowBlankParams or {}) do
         if v ~= '' then
            if v ~= '' or k == param then
            newArgs[k] = v
                newArgs[k] = v
            end
         end
         end
    end
    for i, param in ipairs(cfg.allowBlankParams or {}) do
        newArgs[param] = args[param]
     end
     end
     return newArgs
     return newArgs