Modul:Redirect hatnote: Unterschied zwischen den Versionen
(text= option) |
(Updated from sandbox to fix argument initialization bug) |
||
Zeile 68: | Zeile 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 | ||
Zeile 90: | Zeile 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 |