Wikipedia:Bots/Requests for approval/AnomieBOT 37
This is an old revision of this page, as edited by Josh Parris (talk | contribs) at 04:42, 5 May 2010 ({{BRFA|AnomieBOT|37|Approved}}). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
- The following discussion is an archived debate. Please do not modify it. To request review of this BRFA, please start a new section at WT:BRFA. The result of the discussion was Approved.
Automatic or Manually assisted: Automatic, unsupervised
Programming language(s): Perl
Source code available: User:AnomieBOT/source/tasks/SafesubstFixer.pm
Function overview: Replace {{{subst|}}} in templates with <includeonly>safesubst:</includeonly>, and related edits.
Links to relevant discussions (where appropriate): Wikipedia talk:Template messages/User talk namespace#safesubst:
Edit period(s): As needed
Estimated number of pages affected: Up to ~600 for the first run
Exclusion compliant (Y/N): Yes
Already has a bot flag (Y/N): Yes
Function details: Until recently, the only way to make a template work both when substed and when not substed while also not cluttering the substed output with parser functions (e.g. #if, #switch) was to require a parameter "subst=subst:" be specified when substing. Now we have safesubst: which can be used for the same purpose, and without requiring the oft-forgotten "subst" parameter.
Upon request, the bot will go through a well-defined list of templates and replace {{{subst|}}} parameter uses with the new <includeonly>safesubst:</includeonly> or {{{|safesubst:}}} keyword. It may also insert the new keyword into parser functions lacking any substitution and/or into specifically-named template invocations, as requested.
Discussion
The first run will be for the user warning templates (i.e. Special:PrefixIndex/Template:Uw-). I'm making a generic request in case anyone comes up with another well-defined set of templates that need the same treatment. Anomie⚔ 16:54, 20 April 2010 (UTC)[reply]
Approved for trial (50 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. — The Earwig (talk) 19:13, 25 April 2010 (UTC)[reply]
- Trial complete. [1] Anomie⚔ 20:20, 25 April 2010 (UTC)[reply]
- What's the reason for the
#ifeq:|yes|}}</includeonly>
at the bottom of [2] and [3]? — The Earwig (talk) 22:54, 26 April 2010 (UTC)[reply]- Hmm, I didn't consider that Mediawiki doesn't support nested includeonlys (and I missed seeing it looking at the diffs). This should fix it. Anomie⚔ 01:33, 27 April 2010 (UTC)[reply]
- FWIW, I would recommend using " {{{|safesubst:}}}" instead of "<includeonly>safesubst:</includeonly>" next time: It's shorter, and has no issue with nested includeonly tags. Amalthea 16:10, 3 May 2010 (UTC)[reply]
- How interesting that that works. Although it does have an issue if someone manages to type "{{foo|=bar}}". Anomie⚔ 23:29, 3 May 2010 (UTC)[reply]
- I got it from meta:Help:Safesubst, but it's really just the same mechanics the old subst=subst: thing used. And FWIW, someone at meta considers it a feature that one can opt for one-level substitution by using
{{foo|=}}
, cryptic as it may be. :)
I just use it because it's significantly shorter, and makes for clearer code. Amalthea 23:42, 3 May 2010 (UTC)[reply]- Note though that this is only a suggestion and basically a matter of taste, and should not delay approval. In fact, seeing that MC10 had already manually made that change to a number of templates, which due to a misunderstanding led to some unnecessary reverts (WP:Administrators' noticeboard/Incidents#Massive template breakage), I urge that this job be approved so that it can be wrapped up cleanly. :)
Amalthea 11:24, 4 May 2010 (UTC)[reply]
- Note though that this is only a suggestion and basically a matter of taste, and should not delay approval. In fact, seeing that MC10 had already manually made that change to a number of templates, which due to a misunderstanding led to some unnecessary reverts (WP:Administrators' noticeboard/Incidents#Massive template breakage), I urge that this job be approved so that it can be wrapped up cleanly. :)
- I got it from meta:Help:Safesubst, but it's really just the same mechanics the old subst=subst: thing used. And FWIW, someone at meta considers it a feature that one can opt for one-level substitution by using
- How interesting that that works. Although it does have an issue if someone manages to type "{{foo|=bar}}". Anomie⚔ 23:29, 3 May 2010 (UTC)[reply]
- FWIW, I would recommend using " {{{|safesubst:}}}" instead of "<includeonly>safesubst:</includeonly>" next time: It's shorter, and has no issue with nested includeonly tags. Amalthea 16:10, 3 May 2010 (UTC)[reply]
- Hmm, I didn't consider that Mediawiki doesn't support nested includeonlys (and I missed seeing it looking at the diffs). This should fix it. Anomie⚔ 01:33, 27 April 2010 (UTC)[reply]
- What's the reason for the
A user has requested the attention of a member of the Bot Approvals Group. Once assistance has been rendered, please deactivate this tag by replacing it with {{t|BAG assistance needed}}
.
Will the bot operate per the Function details, or per the Discussion? Josh Parris 14:20, 4 May 2010 (UTC)[reply]
- I can do it either way, I have no preference which. As far as the uw template edits, I'll probably finish them with the includeonly style for consistency with the 50 already done. Anomie⚔ 23:16, 4 May 2010 (UTC)[reply]
Approved. Josh Parris 04:42, 5 May 2010 (UTC)[reply]
- The above discussion is preserved as an archive of the debate. Please do not modify it. To request review of this BRFA, please start a new section at WT:BRFA.