Module:Infobox: Difference between revisions

When a parameter is nil, make sure the function is called with it being set to nil (previously, all other parameters would be shifted left one)
(Fix strict mode errors)
(When a parameter is nil, make sure the function is called with it being set to nil (previously, all other parameters would be shifted left one))
 
(4 intermediate revisions by 2 users not shown)
Line 369:
local func_params = func.params
local func_fetched_params = {}
local i = 1
for _, func_param in ipairs(func_params) do
table.insert(func_fetched_params,[i] = self:get_param(func_param, version))
i = i + 1
end
return func_name(unpack(func_fetched_params))
Line 553 ⟶ 555:
name = 'smw__' + name
end
local data_param = self.switch_datatable:tag('span'):attr('data-attr-param', name)
-- Add each version to the datatable
for version=1, self.versions do
local text = self:get_param(content, version)
if text == nil then
text = self.params[content.param_name].empty
Line 578 ⟶ 580:
-- Create categories
local category_text = ''
if mw.title.getCurrentTitle():inNamespace(0) then
for key, _ in pairs(self.categories) do
category_text = category_text..'[[Category:'..key..']]'
end
end
local dump = ''
481

edits