Jump to content

Module talk:Unsubst

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Anomie (talk | contribs) at 10:38, 27 March 2014 (You can avoid using {{para|$N}}: re). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Edit request on 25 November 2013

I get this error:

 Lua error in Module:Unsubst at
 line 18: attempt to call field
 'isSubsting' (a nil value).

Shouldn't that be isSubstring? MarkAHershberger(talk) 16:27, 25 November 2013 (UTC)[reply]

Note: The module name is "Unsubst", implying a reversal of "subst"; "subst" is a verb, being Wiki shorthand for substitute; so the present participle would be "substing", and may be used in a phrase like "it is substing", hence I think that "isSubsting" is a reasonable name for an identifier, such as a function returning a Boolean result. --Redrose64 (talk) 17:22, 25 November 2013 (UTC)[reply]
Not done: As Redrose64 explained, isSubsting is the correct spelling. Where are you getting this error? Given that we haven't been inundated by people complaining that every maintenance tag (e.g. [citation needed]) is giving script errors, I am skeptical that you're seeing this here on enwiki. On non-WMF wikis, do note that you will need an extremely recent version of Scribunto (or you will have to cherry-pick gerrit:93019). Anomie 18:09, 25 November 2013 (UTC)[reply]

You can avoid using |$N=

You can get the template name from mw.getCurrentFrame():getTitle() Keφr 08:59, 27 March 2014 (UTC)[reply]

I retract that. It does not seem to work. Shame, really. Keφr 09:28, 27 March 2014 (UTC)[reply]
Oh wait, the proper code is mw.getCurrentFrame():getParent():getTitle(), and it does work. (And above, I actually meant mw.getCurrentFrame().parent:getTitle(), which does not.) Keφr 09:50, 27 March 2014 (UTC)[reply]
Sandbox version, needs review and deploy. @Mr. Stradivarius and Jackmcbarn: any final comments? Or should we do this thing? My only comment is that I was worried about the expensive mw.title.new until I realized that only gets called on subst so it'd only be a problem if someone adds ~500 substed maintenance tags in one edit (if even that). Anomie 10:38, 27 March 2014 (UTC)[reply]