Topic on Module talk:TNT

Lua error in Module:TNT

6
Grandtutor (talkcontribs)

I'm getting a lot of the following on templates I've imported from Wikipedia:

Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/Documentation.tab.

Honestly, I'm not sure if the problem is with Lua, Module:TNT or with JsonConfig, which is properly installed. For quick referernce, line 159 in Module:TNT is a part of this function:

-- Give helpful error to thirdparties who try and copy this module.

if not mw.ext or not mw.ext.data or not mw.ext.data.get then

error('Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:' .. dataset)

end

Thanks for any input.

Nagiimos (talkcontribs)

Hi

Did you find the anwer ?

I have the same issue :(

Nagiimos (talkcontribs)

Seems we have to enable mw.data.ext.

Can be done by adding in localsettings.php: $wgJsonConfigEnableLuaSupport = true;.

AstiGallien (talkcontribs)

once having fixed that, i get following error:

Lua error -- Module:TNT:124: mw.text.jsonEncode: Cannot use type 'boolean' as a table key


Json is configured as follows:


wfLoadExtension( 'JsonConfig' );

$wgJsonConfigEnableLuaSupport = true;

// https://www.mediawiki.org/wiki/Extension:JsonConfig#Configuration

$wgJsonConfigModels['Tabular.JsonConfig'] = 'JsonConfig\JCTabularContent';

$wgJsonConfigs['Tabular.JsonConfig'] = [

'namespace' => 486,

'nsName' => 'Data',

// page name must end in ".tab", and contain at least one symbol

'pattern' => '/.\.tab$/',

'license' => 'CC0-1.0',

'isLocal' => false,

];

// Enable Tabular data namespace on Commons - T148745

$wgJsonConfigInterwikiPrefix = 'commons';

$wgJsonConfigs['Tabular.JsonConfig']['remote'] = [

'url' => 'https://commons.wikimedia.org/w/api.php'

];

Nagiimos (talkcontribs)

Thanx !

I missed this jsonconfig part !

AstiGallien (talkcontribs)

does work for you ? i still get Errors, see getting error in Module:TNT


did you install Extension(s) ?

Reply to "Lua error in Module:TNT"