Create the following as Module:Foo:
local p = {}
local f = mw.getCurrentFrame()
function p.main(frame)
return 'The title of the current frame is ' .. f:getTitle()
end
return p
When {{#invoke:Foo|main}} is used in a page, a script error will be generated because f is nil. Note the bug is not present in the console, where running =p.main() will produce the expected result.
Also, if the following is created as Module:Bar:
local p = {}
local d = os.date()
function p.main(frame)
return 'The date when the module was ran was ' .. d
end
return p
{{#invoke:Bar|main}} will return a script error because the TTL logic in os.date() assumes that frames are available at this point, when in fact they are not. Again, this only malfunctions when called from wikitext; =p.main() works properly from the console.
Version: unspecified
Severity: normal