Module:BrandSeries: Difference between revisions

Fix: use broadtable format for more reliable parsing (via update-page on MediaWiki MCP Server)
Add debug output to see query results (via update-page on MediaWiki MCP Server)
Line 32: Line 32:
)
)
local crtResult = frame:preprocess(crtQuery)
local crtResult = frame:preprocess(crtQuery)
-- DEBUG: show raw query result
local debug = '<pre>Query: ' .. crtQuery .. '\n\nResult length: ' .. tostring(#(crtResult or '')) .. '\n\nFirst 2000 chars:\n' .. (crtResult or ''):sub(1, 2000) .. '</pre>'
-- Count occurrences of each series by parsing HTML table
-- Count occurrences of each series by parsing HTML table
Line 68: Line 71:
-- If no series found for this brand
-- If no series found for this brand
if #rows == 0 then
if #rows == 0 then
return "<i>No series-assigned models for this brand.</i>"
return debug .. "<i>No series-assigned models for this brand.</i>"
end
end
Line 104: Line 107:
end
end
return tostring(tbl)
return debug .. tostring(tbl)
end
end


return p
return p
MediaWiki Appliance - Powered by TurnKey Linux