Topic on Extension talk:Scribunto

Jump to navigation Jump to search

Lua error: bad argument #1 to "get" (not a valid title).

5
Wsdmatty (talkcontribs)

I have recently begun a quest to import Template:Quote to my wiki. This was not straightforward and took a lot more time than I anticipated. However, through trial and error and muddling my way through extension installations, I have finally got the template working.

However, Template:Documentation is giving me a Lua error. I don't know if it's mental fatigue or my brain has just given up, but i can't figure out what the actual problem is. Any suggestions would be greatly appreciated.

BT:

Lua error: bad argument #1 to "get" (not a valid title).

Backtrace:

  1. (tail call): ?
  2. [C]: in function "error"
  3. MWServer.lua:81: ?
  4. (tail call): ?
  5. (tail call): ?
  6. Module:TNT:162: in function "loadData"
  7. Module:TNT:181: ?
  8. (tail call): ?
  9. (tail call): ?
  10. Module:Documentation/config:63: in function "init"
  11. package.lua:103: ?
  12. (tail call): ?
  13. mw.lua:486: in function "executeModule"
  14. mw.lua:762: in function "loadData"
  15. Module:Documentation:8: in function "chunk"
  16. mw.lua:486: ?
  17. (tail call): ?
  18. [C]: in function "xpcall"
  19. MWServer.lua:99: in function "handleCall"
  20. MWServer.lua:313: in function "dispatch"
  21. MWServer.lua:70: ?
  22. (tail call): ?
  23. (tail call): ?
  24. (tail call): ?
  25. mw.lua:511: ?
  26. (tail call): ?
  27. [C]: in function "xpcall"
  28. MWServer.lua:99: in function "handleCall"
  29. MWServer.lua:313: in function "dispatch"
  30. MWServer.lua:52: in function "execute"
  31. mw_main.lua:7: in main chunk
  32. [C]: ?


Tacsipacsi (talkcontribs)

Did you set JsonConfig up? The relevant parts from Wikimedia’s CommonSettings.php are:

// Safety: before extension.json, these values were initialized by JsonConfig.php
if ( !isset( $wgJsonConfigModels ) ) {
	$wgJsonConfigModels = [];
}
if ( !isset( $wgJsonConfigs ) ) {
	$wgJsonConfigs = [];
}

$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'
];
Wsdmatty (talkcontribs)

Thank you very much for this. I had not set it up properly but this fixed my problem.

Odoxo (talkcontribs)

This took me an age to figure out, should be more prominent in the JsonConfig help section - thank you!

Sachinpatel393 (talkcontribs)

after copy above settings in localsettings.php

now getting this error:

Lua error in Module:Documentation at line 137: message: type error in message cfg.main-div-classes (string expected, got nil).

Reply to "Lua error: bad argument #1 to "get" (not a valid title)."