Module:Submit an edit request: Difference between revisions

Content deleted Content added
Restored revision 1027191154 by Izno (talk): Reasonable request for rolling back the last changes – requested by Pppery in Special:Diff/1039776209
remove unnecessary isTranscludedOnMainPage check, code by User:andrybak
Line 29:
return mw.message.newRawMessage(msg):params(params):plain()
end
end
 
local function isTranscludedOnMainPage(titleObj)
local mainPage = message('main-page')
for i, source in ipairs(titleObj.cascadingProtection.sources) do
if source == mainPage then
return true
end
end
return false
end
 
Line 60 ⟶ 50:
function p.makeRequestUrl(level, titleObj)
titleObj = titleObj or mw.title.getCurrentTitle()
local basePage = titleObj.basePageTitle.fullText
if isTranscludedOnMainPage(titleObj) then
if cfg['main-page-content'][basePage] then
local basePage = titleObj.basePageTitle.fullText
return tostring(mw.uri.fullUrl(message('main-page-request-page')))
if cfg['main-page-content'][basePage] then
return tostring(mw.uri.fullUrl(message('main-page-request-page')))
end
end
 
local talkPageName = titleObj.talkPageTitle
if talkPageName == nil then