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

            Bug ID: 63597
           Summary: Fatal exception when callParserFunction is used to
                    call #coordinates with integer args
           Product: MediaWiki extensions
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Scribunto
          Assignee: wikibugs-l@lists.wikimedia.org
          Reporter: orlod...@wiki256.net
                CC: bjor...@wikimedia.org, tstarl...@wikimedia.org,
                    vasi...@gmail.com
       Web browser: ---
   Mobile Platform: ---

The GeoData extension provides a parser function called "#coordinates". When
the lua function callParserFunction is used in a module to call #coordinates
with two integer arguments, a fatal exception occurs.

Steps to reproduce:

1. Create "Module:Sandbox" with this content:
local sandbox = {};
function sandbox.test(frame)
    frame:callParserFunction('#coordinates', {80, 30})
    return "abc"
end
return sandbox

2. Create a page with "{{#invoke:Sandbox|test}}" and save.

(example on frwiki:
https://fr.wikipedia.org/w/index.php?title=Module:Sandbox&oldid=102691262,
https://fr.wikipedia.org/wiki/Utilisateur:Orlodrim/callParserFunction)

I am not completely sure that it is a bug in Scribunto, rather than in GeoData,
but note that the following code (with string arguments) does not cause an
exception:

frame:callParserFunction('#coordinates', {'80', '30'})


Stack trace on my personal test wiki:

[a6b06752] /mediawiki-git/core/index.php?title=User:127.0.0.1&action=submit
Exception from line 1205 of
/home/orlodrim/mediawiki/core/includes/parser/Preprocessor_DOM.php:
PPFrame_DOM::expand: Invalid parameter type

Backtrace:

#0
/home/orlodrim/mediawiki/extensions/GeoData/CoordinatesParserFunction.php(82):
PPFrame_DOM->expand(integer)
#1
/home/orlodrim/mediawiki/extensions/GeoData/CoordinatesParserFunction.php(49):
CoordinatesParserFunction->parseArgs(PPTemplateFrame_DOM, array)
#2 [internal function]: CoordinatesParserFunction->coordinates(Parser,
PPTemplateFrame_DOM, array)
#3 /home/orlodrim/mediawiki/core/includes/parser/Parser.php(3616):
call_user_func_array(array, array)
#4
/home/orlodrim/mediawiki/extensions/Scribunto/engines/LuaCommon/LuaCommon.php(502):
Parser->callParserFunction(PPTemplateFrame_DOM, string, array)
#5 [internal function]: Scribunto_LuaEngine->callParserFunction(string, string,
array)
#6
/home/orlodrim/mediawiki/extensions/Scribunto/engines/LuaStandalone/LuaStandaloneEngine.php(401):
call_user_func_array(array, array)
#7
/home/orlodrim/mediawiki/extensions/Scribunto/engines/LuaStandalone/LuaStandaloneEngine.php(379):
Scribunto_LuaStandaloneInterpreter->callback(string, array)
#8
/home/orlodrim/mediawiki/extensions/Scribunto/engines/LuaStandalone/LuaStandaloneEngine.php(426):
Scribunto_LuaStandaloneInterpreter->handleCall(array)
#9
/home/orlodrim/mediawiki/extensions/Scribunto/engines/LuaStandalone/LuaStandaloneEngine.php(307):
Scribunto_LuaStandaloneInterpreter->dispatch(array)
#10
/home/orlodrim/mediawiki/extensions/Scribunto/engines/LuaCommon/LuaCommon.php(195):
Scribunto_LuaStandaloneInterpreter->callFunction(Scribunto_LuaStandaloneInterpreterFunction,
Scribunto_LuaStandaloneInterpreterFunction)
#11
/home/orlodrim/mediawiki/extensions/Scribunto/engines/LuaCommon/LuaCommon.php(672):
Scribunto_LuaEngine->executeFunctionChunk(Scribunto_LuaStandaloneInterpreterFunction,
PPTemplateFrame_DOM)
#12 /home/orlodrim/mediawiki/extensions/Scribunto/common/Hooks.php(108):
Scribunto_LuaModule->invoke(string, PPTemplateFrame_DOM)
#13 [internal function]: ScribuntoHooks::invokeHook(Parser, PPFrame_DOM, array)
#14 /home/orlodrim/mediawiki/core/includes/parser/Parser.php(3616):
call_user_func_array(string, array)
#15 /home/orlodrim/mediawiki/core/includes/parser/Parser.php(3333):
Parser->callParserFunction(PPFrame_DOM, string, array)
#16 /home/orlodrim/mediawiki/core/includes/parser/Preprocessor_DOM.php(1113):
Parser->braceSubstitution(array, PPFrame_DOM)
#17 /home/orlodrim/mediawiki/core/includes/parser/Parser.php(3150):
PPFrame_DOM->expand(PPNode_DOM, integer)
#18 /home/orlodrim/mediawiki/core/includes/parser/Parser.php(1212):
Parser->replaceVariables(string)
#19 /home/orlodrim/mediawiki/core/includes/parser/Parser.php(395):
Parser->internalParse(string)
#20 /home/orlodrim/mediawiki/core/includes/content/WikitextContent.php(306):
Parser->parse(string, Title, ParserOptions, boolean, boolean, NULL)
#21 /home/orlodrim/mediawiki/core/includes/EditPage.php(3248):
WikitextContent->getParserOutput(Title, NULL, ParserOptions)
#22 /home/orlodrim/mediawiki/core/includes/EditPage.php(2185):
EditPage->getPreviewText()
#23 /home/orlodrim/mediawiki/core/includes/EditPage.php(441):
EditPage->showEditForm()
#24 /home/orlodrim/mediawiki/core/includes/actions/EditAction.php(50):
EditPage->edit()
#25 /home/orlodrim/mediawiki/core/includes/actions/EditAction.php(74):
EditAction->show()
#26 /home/orlodrim/mediawiki/core/includes/Wiki.php(441): SubmitAction->show()
#27 /home/orlodrim/mediawiki/core/includes/Wiki.php(305):
MediaWiki->performAction(Article, Title)
#28 /home/orlodrim/mediawiki/core/includes/Wiki.php(596):
MediaWiki->performRequest()
#29 /home/orlodrim/mediawiki/core/includes/Wiki.php(460): MediaWiki->main()
#30 /home/orlodrim/mediawiki/core/index.php(49): MediaWiki->run()
#31 {main}

-- 
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
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to