Module:Favilink: Difference between revisions

Jump to navigation Jump to search
mNo edit summary
m (Undo revision 13746 by Teamtoto (talk))
Line 6: Line 6:
function p.favilink(frame, searchtype)
function p.favilink(frame, searchtype)
local displayname_tooltip_override = false
local displayname_tooltip_override = false
local args = frame
if frame == mw.getCurrentFrame() then
args = require('Module:ProcessArgs').merge(true)
else
frame = mw.getCurrentFrame()
end


--[Getting query results...]
--[Getting query results...]
Line 20: Line 14:
searchtype = searchtype or 'PlainName'
searchtype = searchtype or 'PlainName'
   
   
if args ~= nil and args ~= '' then
if frame.args ~= nil and frame.args ~= '' then
   if args[1] ~= nil and args[1] ~= '' then
   if frame.args[1] ~= nil and frame.args[1] ~= '' then
   name = mw.text.trim(frame:preprocess(args[1]))
   name = mw.text.trim(frame:preprocess(frame.args[1]))
   modifier = mw.text.trim(frame:preprocess(args[2]))
   modifier = mw.text.trim(frame:preprocess(frame.args[2]))
   else
   else
     error "There is no argument specified! [[Category:pages with favilink errors]]"
     error "There is no argument specified! [[Category:pages with favilink errors]]"