Module:Requested move and Module:Requested move/sandbox: Difference between pages

(Difference between pages)
Page 1
Page 2
imported>DannyS712
m simplify some code (should be a no-op; if there are any errors no discussion is needed before reverting (WP:TPEDISPUTE))
 
imported>SilverLocust
instead put the protection checks after the error checks
 
Line 91: Line 91:
if not validTitle then
if not validTitle then
-- If invalid, the second parameter is the error message.
-- If invalid, the second parameter is the error message.
return currentTitle
local msg = currentTitle
return msg
end
end
return 'yes'
return 'yes'
Line 192: Line 193:
-- multiple nomination.
-- multiple nomination.
local argsByNumCount = #argsByNum
local argsByNumCount = #argsByNum
local multi = (argsByNumCount >= 2)
local multi
 
if argsByNumCount >= 2 then
multi = true
else
multi = false
end
--[[
--[[
-- Validate new params.
-- Validate new params.
Line 213: Line 219:
end
end
end
end
 
----------------------------------------------------------------------------
----------------------------------------------------------------------------
-- Error checks
-- Error checks
Line 425: Line 431:


local rmd = {}
local rmd = {}
rmd[#rmd + 1] = '{{requested move/dated'
rmd[#rmd + 1] = '{{requested move/dated/sandbox'


if multi then
if multi then
Line 508: Line 514:


-- Talk blurb
-- Talk blurb
local talk = ''
local talk
if yesno(args.talk, true) then
if yesno(args.talk, true) then
talk = frame:expandTemplate{title = 'Requested move/talk'}
talk = frame:expandTemplate{title = 'Requested move/talk'}
else
talk = ''
end
end