Content deleted Content added
→Lua error: attempt to compare string with number.: new section |
→Lua error: attempt to compare string with number.: pairs(invArgs) |
||
Line 17:
The issue seems to be caused by template invocation, in which a positional parameter is <code><nowiki>{{=}}</nowiki></code> and at least one named parameter is present. I've added <code>test14_equals_sign_parameter</code> to [[Module:Template test case/testcases]] to demonstrate the issue. —[[User:Andrybak|andrybak]] ([[User talk:Andrybak|talk]]) 14:25, 19 May 2020 (UTC)
:I haven't looked at what this module does or how it's used but the cause of the error is simple. A loop at line 104 uses pairs(invArgs) to put each key (parameter name) into the invArgs_list array. That will include numbers like 1 if the first unnamed parameter is entered, and strings like the names of any named parameters. Line 107 then fails because it cannot sort a mixture of numbers and strings. Someone would have to work out what the module wants to do at that point (why is it sorting the parameters names?) and decide what should happen to numbered parameters. Perhaps they should be omitted, or converted to strings. Or, add a custom sort routine to put the numbers before the strings. Ping me if help is wanted with implementing any of this after deciding what is wanted. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 23:39, 19 May 2020 (UTC)
|