Module:Redirect hatnote: Difference between revisions
From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
Content added Content deleted
(text= option) |
(Updated from sandbox to fix argument initialization bug) |
||
Line 68: | Line 68: | ||
-- Functionality for adding categories |
-- Functionality for adding categories |
||
local categoryTable = {} |
local categoryTable = {} |
||
function addCategory(cat) |
local function addCategory(cat) |
||
if cat and cat ~= '' then |
if cat and cat ~= '' then |
||
-- Add by index to avoid duplicates |
-- Add by index to avoid duplicates |
||
Line 90: | Line 90: | ||
local mRedirect = require('Module:Redirect') |
local mRedirect = require('Module:Redirect') |
||
local target = mRedirect.getTarget(redirectTitle) |
local target = mRedirect.getTarget(redirectTitle) |
||
target = targetTitle or target and getTitle(target) |
|||
if |
if target and target ~= currentTitle then |
||
addCategory('Articles with redirect hatnotes needing review') |
addCategory('Articles with redirect hatnotes needing review') |
||
end |
end |