Last modified: 2014-06-28 07:51:46 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T69201, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 67201 - mw.ustring methods don't allow numbers where corresponding string methods do
mw.ustring methods don't allow numbers where corresponding string methods do
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Scribunto (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Brad Jorsch
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-27 16:03 UTC by Jackmcbarn
Modified: 2014-06-28 07:51 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Jackmcbarn 2014-06-27 16:03:49 UTC
In this module:

local p = {}

function p.main(frame)
	local builder = mw.html.create('span'):css('opacity', 0)
	return tostring(builder)
end

return p

The call to p.main() results in the following script error:

Lua error: bad argument #1 to 'gsub' (string expected, got number).

Backtrace:

    [C]: in function "v"
    mw.ustring.lua:61: ?
    (tail call): ?
    mw.html.lua:113: in function "_build"
    mw.html.lua:51: ?
    [C]: in function "tostring"
    Module:Sandbox/Jackmcbarn:5: in function "chunk"
    mw.lua:478: ?
Comment 1 Brad Jorsch 2014-06-27 16:20:38 UTC
Not actually a bug in mw.html, it's that mw.ustring isn't autoconverting numbers where Lua's standard string library does.
Comment 2 Gerrit Notification Bot 2014-06-27 16:23:23 UTC
Change 142563 had a related patch set uploaded by Jackmcbarn:
Fix strange mw.html errors with numeric arguments

https://gerrit.wikimedia.org/r/142563
Comment 3 Jackmcbarn 2014-06-27 16:24:45 UTC
Well, it's partially both. There's other ways to cause this that make it fail in places other than ustring.
Comment 4 Gerrit Notification Bot 2014-06-27 16:32:49 UTC
Change 142567 had a related patch set uploaded by Anomie:
mw.ustring functions should accept numbers where string functions do

https://gerrit.wikimedia.org/r/142567
Comment 5 Gerrit Notification Bot 2014-06-27 18:37:19 UTC
Change 142567 merged by jenkins-bot:
mw.ustring functions should accept numbers where string functions do

https://gerrit.wikimedia.org/r/142567
Comment 6 Marius Hoch 2014-06-28 07:51:18 UTC
Both related patches merged
Comment 7 Gerrit Notification Bot 2014-06-28 07:51:46 UTC
Change 142563 merged by jenkins-bot:
Fix strange mw.html errors with numeric arguments

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links