Page MenuHomePhabricator

Lua error in mw.html.lua for {{infobox}} template from Wikipedia
Closed, InvalidPublic

Description

[edit]
On a version 1.23.6, I've just imported Wikipedia templates: reflist, infobox and navbox, along with other templates they transclude. On many of these pages is the red "Script error" with "Lua error in mw.html.lua at line 345: Tag name must be a string." {{reflist}} and {{navbox}} seem to work ok but on a page where infobox is supposed to appear is the red Script Error instead.


Version: REL1_23-branch
Severity: major

Details

Reference
bz72880

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:57 AM
bzimport added a project: Scribunto.
bzimport set Reference to bz72880.
bzimport added a subscriber: Unknown Object (MLST).

(The above was sent too soon.) I've just imported a bunch of templates from Wikipedia along with whatever other templates Special:Export included. Now on the other wiki on many of these pages, there is in red "Script error" with "Lua error in mw.html.lua at line 345: Tag name must be a string." Some templates like reflist and navbox seem to still function but instead of infobox the page has the red Script Error instead.

So... what are you reporting here? Of course tag names must be strings.

That (Wikipedia) Scribunto templates that should work fine instead have errors or don't work at all on non-WMF wikis.

I'm not writing the scripts or templates, that's how they come exported from Wikipedia.

A lot of templates from enwiki require you to use the latest version of MediaWiki (and extensions) to work properly. Note that the latest stable version is always several months behind this version.

Also, please provide the full error (including the backtrace) rather than just the first line.

BTW the templates were all exported from Wikipedia yesterday. The wiki is using the latest stable version 1.23.6. Just in case it might help, extensions Scribunto and Parser were replaced yesterday. All the rest of the extensions are for release 1.23. I've also copy pasted Common.css and Common.js straight from Wikipedia.

On the page with the infobox template:
Lua error in mw.html.lua at line 314: Invalid CSS given: Must be either a string or a number.
Backtrace:
(tail call): ?
[C]: in function "error"
mw.html.lua:314: in function "cssText"
Module:Infobox:252: ?
(tail call): ?
mw.lua:567: ?
(tail call): ?
[C]: in function "xpcall"
MWServer.lua:87: in function "handleCall"
MWServer.lua:301: in function "dispatch"
MWServer.lua:40: in function "execute"
mw_main.lua:7: in main chunk
[C]: ?

On the infobox template page, the same error and:
Lua error in mw.html.lua at line 345: Tag name must be a string.
Backtrace:
(tail call): ?
[C]: in function "error"
mw.html.lua:345: in function "create"
Module:Documentation:129: ?
(tail call): ?
mw.lua:567: ?
(tail call): ?
[C]: in function "xpcall"
MWServer.lua:87: in function "handleCall"
MWServer.lua:301: in function "dispatch"
MWServer.lua:40: in function "execute"
mw_main.lua:7: in main chunk
[C]: ?

1.23 isn't the latest version. It's just the latest stable version. Wikimedia servers run a development release of 1.25.

Then Wikipedia templates are incompatible with 1.23

{{infobox}} from which Wikipedia? Link welcome. There are some languages... :)

(In reply to Rob Kam from comment #8)

Then Wikipedia templates are incompatible with 1.23

Yes, some of them are.

I've looked into the specific cause in the above cases, and they're both caused by changes to mw.html in version 1.24. Although in general, core and extensions should be kept at the same version, the 1.24 branch of Scribunto is compatible with MediaWiki core 1.23. To fix the problem, you can either use 1.24 Scribunto, or if you'd rather not do that for some other reason, you can cherry-pick just the one change you need by running "git cherry-pick d1030989bc41d9fcf9b85a1496b99757077024f0" from the Scribunto directory (assuming you got it from Git).

There's no bug here, though.

Thanks! Changing to 1.24 Scribunto has fixed it.