Module:Infobox: Difference between revisions
Fix category version bug
(Shorten subobject name) |
(Fix category version bug) |
||
Line 9:
local Infobox = {}
Infobox.__index = Infobox
--[[
Line 239 ⟶ 238:
end
self.versions = i - 1
-- Handle the no version case - check for a custom version_name▼
if self.versions == 0 then▼
table.insert(self.version_names, self.args_raw['version'] or 'DEFAULT')▼
end▼
-- Should either have 0 or 2+ versions
if self.versions == 1 then
table.insert(self.errors, 'There should be multiple versions or no versions. If defining a custom version name for a single entry, use "version=Name" instead of "version1=Name".')
▲ end
self.versions = 0▼
▲ -- Handle the no version case - check for a custom version_name
▲ if self.versions == 0 then
▲ table.insert(self.version_names, self.args_raw['version'] or 'DEFAULT')
end
-- Check for a default_version
Line 444 ⟶ 443:
--]]
function Infobox:store_smw()
for version=1, self.versions do▼
▲ for version=1, versions do
-- Generate a subobject name
-- Reminder - subobject name cannot have a . in the first 5 characters
Line 502 ⟶ 500:
--]]
function Infobox:add_switch_data(content)
if self.versions <
return false
end
|