Module:BrandSeries: Difference between revisions
Fix parameter passing - check frame.args first, then parent (via update-page on MediaWiki MCP Server) |
Remove debug output, filter out invalid "+" series entries (via update-page on MediaWiki MCP Server) |
||
| Line 35: | Line 35: | ||
) | ) | ||
local crtResult = frame:preprocess(crtQuery) | local crtResult = frame:preprocess(crtQuery) | ||
-- Count occurrences of each series by parsing HTML table | -- Count occurrences of each series by parsing HTML table | ||
| Line 53: | Line 50: | ||
if #cells >= 2 and cells[2] then | if #cells >= 2 and cells[2] then | ||
local series = cells[2] | local series = cells[2] | ||
if series and series ~= '' then | -- Filter out invalid series values like "+" | ||
if series and series ~= '' and series ~= '+' then | |||
seriesCounts[series] = (seriesCounts[series] or 0) + 1 | seriesCounts[series] = (seriesCounts[series] or 0) + 1 | ||
end | end | ||
| Line 74: | Line 72: | ||
-- If no series found for this brand | -- If no series found for this brand | ||
if #rows == 0 then | if #rows == 0 then | ||
return | return "" | ||
end | end | ||
| Line 110: | Line 108: | ||
end | end | ||
return | return tostring(tbl) | ||
end | end | ||
return p | return p | ||