Page MenuHomePhabricator

Error message in mw.loadJsonData uses the wrong variable
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • The error message in the function mw.loadJsonData on line 792 of mw.lua refers to the undeclared variable arg, instead of module.

What happens?:

  • Inputting an invalid data type (such as a table) always results in the error message bad argument #1 to 'mw.loadJsonData' (string expected, got nil), even when the input is not nil, because arg is an undeclared global variable.

What should have happened instead?:

  • The error message should display the correct type. For example, if the input is a table, the error should be bad argument #1 to 'mw.loadJsonData' (string expected, got table).

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Event Timeline

Change #1031884 had a related patch set uploaded (by Theknightwho; author: Theknightwho):

[mediawiki/extensions/Scribunto@master] Use correct variable for error message in `mw.loadJsonData`

https://gerrit.wikimedia.org/r/1031884

Change #1031884 merged by jenkins-bot:

[mediawiki/extensions/Scribunto@master] Use correct variable for error message in `mw.loadJsonData`

https://gerrit.wikimedia.org/r/1031884

SD0001 assigned this task to Theknightwho.