Content deleted Content added
m Archiving 1 discussion(s) from Template talk:Documentation) (bot |
m Archiving 1 discussion(s) from Template talk:Documentation) (bot |
||
Line 434:
::::For now, yes, just use [1]. In the future, an update to MediaWiki could allow multiple protection levels on the same action. (Beware that if the page is unprotected, the return value may be {}, not always { edit = {} } as you might expect. [[User:Jackmcbarn|Jackmcbarn]] ([[User talk:Jackmcbarn|talk]]) 02:50, 13 March 2014 (UTC)
:::::Thanks, that helps a lot. I've now updated the module to use protectionLevels, so I guess we can consider this request answered. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 04:08, 13 March 2014 (UTC)
== Lua error in Module:Documentation at line 409: attempt to index local 'protectionLevels' (a nil value). ==
I've exported a few modules and templates from MediaWiki and imported them into my own wiki and as soon as I open a template (e.g. Template:Documentation, Template:Divbox, Template:Ombox), I get the following script error:
<pre>
Lua error in Module:Documentation at line 409: attempt to index local 'protectionLevels' (a nil value).
Backtrace:
(tail call): ?
Module:Documentation:409: in function "protectionTemplate"
Module:Documentation:132: ?
(tail call): ?
mw.lua:553: ?
(tail call): ?
[C]: in function "xpcall"
MWServer.lua:73: in function "handleCall"
MWServer.lua:266: in function "dispatch"
MWServer.lua:33: in function "execute"
mw_main.lua:7: in main chunk
[C]: ?
</pre>
I searched for hours on Google to find a solution, but no luck. Any help would be highly appreciated. [[User:Tessus|Tessus]] ([[User talk:Tessus|talk]]) 23:07, 18 March 2014 (UTC)
:This module relies on features new to MediaWiki 1.23 and/or the latest git version of [[mw:Extension:Scribunto]]. [[User:Jackmcbarn|Jackmcbarn]] ([[User talk:Jackmcbarn|talk]]) 00:01, 19 March 2014 (UTC)
::I've fixed the module so that it won't produce a script error if protectionLevels is not present. However, if you don't have protectionLevels on your wiki you might want to use [https://en.wikipedia.org/w/index.php?title=Module:Documentation&oldid=598387866 this version] of the module which uses the <code><nowiki>{{PROTECTIONLEVEL}}</nowiki></code> parser function, as otherwise the protection icons in the top-hand-corner of the page won't work. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 00:54, 19 March 2014 (UTC)
:::Thanks, but I have no idea what you are suggesting. I have installed MediaWiki 1.22.4, I have no clue why/how I should or should not have protectionLevels on my wiki. I'm not entirely sure what I shall do now. Shall I use the old version or your fixed version? [[User:Tessus|Tessus]] ([[User talk:Tessus|talk]]) 01:06, 19 March 2014 (UTC)
::::Either upgrade your Scribunto extension to the latest version available, or use the version of the module that Mr. Stradivarius showed you. [[User:Jackmcbarn|Jackmcbarn]] ([[User talk:Jackmcbarn|talk]]) 01:13, 19 March 2014 (UTC)
:::::I tried the latest version of Scibunto, but it didn't help. Then I tried the latest Module:Documentation and it seems to work. But I'm still missing all the images which the templates depend on. Also the background of the template documentation is green on wikipedia, white on my wiki. Well, it's not really an issue, just a difference. Do you know, if there is a way to grab all the necessary images from wikipedia (e.g. Imbox_notice.png) which are necessary for a template? [[User:Tessus|Tessus]] ([[User talk:Tessus|talk]]) 01:26, 19 March 2014 (UTC)
::::::Not sure about the images. For the green background, you also need to import [[MediaWiki:Common.css]]. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 03:22, 19 March 2014 (UTC)
:::::::Yep, did that, or at least parts of it. I guess I was not thorough enough. Thx for all your help. [[User:Tessus|Tessus]] ([[User talk:Tessus|talk]]) 05:16, 19 March 2014 (UTC)
::::::::The important class from Common.css is the <code>template-documentation</code> class. It looks like you also need to import [[MediaWiki:Common.js/IEFixes.js]] to make the <code>iezoomfix</code> class work properly, but that only matters if you are interested in supporting Internet Explorer 8. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 05:36, 19 March 2014 (UTC)
:::::::::Info for using images from Wikimedia Commons - [[mw:Manual:$wgUseInstantCommons]] and [[mw:InstantCommons]]--[[User:Lam-ang|Lam-ang]] ([[User talk:Lam-ang|talk]]) 06:03, 19 March 2014 (UTC)
::::::::::Thanks for all your help and info. [[User:Tessus|Tessus]] ([[User talk:Tessus|talk]]) 05:17, 20 March 2014 (UTC)
|