Module:Copied/sandbox: Difference between revisions

Content deleted Content added
fix for Template talk:
Add a fallback for no/bad arguments into |from= when mergedFrom is true
Line 56:
text = string.format("%s The former page's [%s history] now serves to [[WP:Copying within Wikipedia|provide attribution]] for that content in the latter page, and it must not be deleted as long as the latter page exists.",text,tostring(mw.uri.fullUrl(from,{action="history"}) or ""))
if (args["talk"] == 'yes' or (mergedFrom == 'yes' and args["talk"] ~= 'no')) then
local fromTalkfromPage = mw.title.new(from).talkPageTitle.fullText
local fromTalk = fromPage and fromPage.talkPageTitle.fullText or "Talk:" .. from
text = string.format("%s For the discussion at that ___location, see its [[%s|talk page]].", text, fromTalk)
end
Line 81 ⟶ 82:
local talk = args["talk".. i] or ""
if (talk == "yes" or (args["mergedFrom"] == 'yes' and talk ~= "no")) then
local fromTalkfromPage = mw.title.new(from).talkPageTitle.fullText
local fromTalk = fromPage and fromPage.talkPageTitle.fullText or "Talk:" .. from
text = string.format("%s[[%s|talk]], ", text, fromTalk)
end