Module:Lockbox: Difference between revisions

Content deleted Content added
don't show warnings on pages transcluding a lockbox, and make page-name-processing logic more robust by using mw.title objects
Avoid an unnecessary call to frame:preprocess, code by User:Jackmcbarn
Line 44:
-- This creates an extaneous self-transclusion for all pages using the
-- module, but we treat that as a necessary evil.
--
-- XXX: there seems to be no way to check for cascading protection using a
-- Scribunto API, so we have to use frame:preprocess with the
-- CASCADINGSOURCES parser function.
do
mw.title.getCurrentTitle():getContent() -- Generate self-transclusion
local parent_title = frame:getParent():getTitle()
if frame:preprocess('{{CASCADINGSOURCES:'not mw.title. new(parent_title ).cascadingProtection. '}}') == ''sources[1] then
warnings[#warnings + 1] = make_wikitext_warning(string.format(
'the page "%s" is not cascade-protected',