Module:Article history: Difference between revisions

Content deleted Content added
m remove unnecessary "or {}"
use HTML objects to calculate the count of collapsible rows, rather than the number of action and collapsible notice objects, otherwise the count is incorrect when any errors are generated
Line 562:
end
 
-- Get theaction countobjects ofand the collapsible rowsnotice objects, and generate their
-- HTML objects. Use the HTML objects to calculate the number of collapsible
-- rows. (We can't use the count of action and collapsible notice objects
-- themselves, as it is inaccurate if they generate any errors.)
local actionHtmlObjects, collapsibleNoticeHtmlObjects = {}, {}
local actions = self:getActionObjects()
local collapsibleNotices = self:getCollapsibleNoticeObjects()
for _, obj in ipairs(actions or {}) do
local noCollapsibleRows = #actions + #collapsibleNotices
table.insert(
actionHtmlObjects,
self:try(obj.exportHtml, obj, self)
)
end
for _, obj in ipairs(collapsibleNotices or {}) do
table.insert(
collapsibleNoticeHtmlObjects,
self:try(obj.exportHtml, obj, self)
)
end
local noCollapsibleRows = #actionsactionHtmlObjects + #collapsibleNoticescollapsibleNoticeHtmlObjects
 
-- Collapsible table for actions and collapsible notices
Line 632 ⟶ 648:
 
-- Actions and collapsible notices
for i, t in ipairs{actionsactionHtmlObjects, collapsibleNoticescollapsibleNoticeHtmlObjects} do
for j, objhtmlObj in ipairs(t) do
collapsibleTable:node(self:try(obj.exportHtml, obj, self)htmlObj)
end
end