Jump to content

Module:Lua banner: Difference between revisions

no edit summary
No edit summary
No edit summary
 
Line 110: Line 110:
for i, module in ipairs(modules) do
for i, module in ipairs(modules) do
if module ~= "WP:libraryUtil" then
if module ~= "WP:libraryUtil" then
local moduleProt = mw.title.new(module).protectionLevels["edit"][1]
local moduleTitle = mw.title.new(module)
local moduleProt = moduleTitle.protectionLevels["edit"] and moduleTitle.protectionLevels["edit"][1] or nil
if moduleProt == nil then moduleProt = 0 else moduleProt = protLevels[moduleProt] end
if moduleProt == nil then moduleProt = 0 else moduleProt = protLevels[moduleProt] end
if moduleProt < currentProt then
if moduleProt < currentProt then