https://bugzilla.wikimedia.org/show_bug.cgi?id=64141

            Bug ID: 64141
           Summary: Metatables don't work from wikitext
           Product: MediaWiki extensions
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Scribunto
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]
       Web browser: ---
   Mobile Platform: ---

Create Module:Foo with the following code:
local p, mt = {}, {}

function mt.__index(table, key)
    return function(frame)
        return 'You called the ' .. key .. ' function'
    end
end

setmetatable(p, mt)

return p

From the console, "=p.bar()" correctly produces "You called the bar function".
However, from wikitext, "{{#invoke:Foo|bar}}" instead produces "Script error:
The function "bar" does not exist."

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to