Module:WikiProject banner/sandbox: Difference between revisions

Content deleted Content added
pass arguments correctly
move helper function inward
Line 328:
local new_class = class
-- temporary transition code
local category_exists_suffix = function(class, oldsuffix)
local cat = mw.title.new(cfg.quality.assessment_category:format(class, category .. ' ' .. (oldsuffix and 'articles' or 'pages')))
return cat.exists and #cat:getContent()>0 -- check if category exists and is not blank
end
local category_exists = function(class)
local category_exists_suffixcheck_suffix = function(class, oldsuffix)
return category_exists_suffix(class, false) or category_exists_suffix(class, true)
local cat = mw.title.new(cfg.quality.assessment_category:format(class, category .. ' ' .. (oldsuffix and 'articles' or 'pages')))
return cat.exists and #cat:getContent()>0 -- check if category exists and is not blank
end
return check_suffix(false) or check_suffix(true)
end
if class=='FM' and not category_exists('FM') then