Category talk:Pages using duplicate arguments in template calls/Archive 1

Earlier discussion
For ease of reference, the earrlier discussion is at: Village pump (technical)/Archive 131. --NSH002 (talk) 09:54, 11 November 2014 (UTC)

Template:MMAevent bout
MMAevent bout uses positional parameters only, and it appears to generate a duplicate parameter error when both the weight class and the notes parameters are left as empty. See, for example, UFC 2 and 1993 in Shooto. This template is transcluded in 530 articles. – Jonesey95 (talk) 00:02, 27 October 2014 (UTC)
 * Have a look at any of [//en.wikipedia.org/w/index.php?title=Special:Contributions/Redrose64&offset=20141026200640&limit=16 these edits]. If you do the same on UFC 2 and its many friends, that should sort it. -- Red rose64 (talk) 00:07, 27 October 2014 (UTC)


 * Fixed with [//en.wikipedia.org/w/index.php?title=UFC_2&diff=prev&oldid=631255720 this] and [//en.wikipedia.org/w/index.php?title=1993_in_Shooto&diff=prev&oldid=631255884 this] edits. -- WOSlinker (talk) 00:10, 27 October 2014 (UTC)
 * Looks good. Thanks. I tend to draw incorrect conclusions sometimes (in this case about the two empty parameters), but I try hard to avoid editing based on them. Hence my question here. – Jonesey95 (talk) 00:15, 27 October 2014 (UTC)

Cycling data templates
The Ct template appears to be causing duplicate parameter errors, for example in UCI Professional Continental teams.

I think I have tracked it down to the individual team templates that are called by Ct, such as Cycling data AND. Some of these templates have a form of error checking that looks for a year that is not specified. This error checking appears to set team-name-2014 twice if you specify 2014 in the Cycling data AND template call.

As always, I could be off track, but as always, when I think I'm off track, I post a question instead of trying to fix it. – Jonesey95 (talk) 17:49, 27 October 2014 (UTC)
 * Yep, that's the problem. It's not so obvious how to fix it, though. — Mr. Stradivarius  ♪ talk ♪ 21:43, 27 October 2014 (UTC)
 * The right way to fix that is probably to convert them to data modules. We could also convert the callers to modules, but if we don't want to do that yet, we can quick-fix it with Module:Data. Jackmcbarn (talk) 23:37, 27 October 2014 (UTC)
 * Could "switch" be used somehow? I'm guessing that a nest of if statements would be too awful to contemplate. I am not a programmer. – Jonesey95 (talk) 00:07, 28 October 2014 (UTC)

It appears that has fixed these templates by moving the error checking and categorization code outside of the template (I do not know where, but everything is still working, as far as I can tell). Go team! – Jonesey95 (talk) 04:33, 28 October 2014 (UTC)
 * yes. the tracking has been moved to Template:Cycling team link and Template:Cycling team nolink. the method being used was a problem since it was generating a category inside a wikilink.  so, it had to be moved even without this particular side-effect. Frietjes (talk) 14:47, 28 October 2014 (UTC)

Railway lines
Anyone want to take on some railway line templates? I haven't been able to figure them out. Examples: KL Monorail Line, Nagapattinam–Tiruchirappalli line, Newcastle-Gateshead RDT, Rapid Rail network. My wild guess is that they transclude a common template that is causing the error to appear. – Jonesey95 (talk) 16:00, 28 October 2014 (UTC)
 * I have fixed a couple of these, and there does not appear to be an underlying template that is causing a problem. 's "Find dups" script can help find the problems.

importScript('User:Frietjes/findargdups.js'); // User:Frietjes/findargdups


 * The above script, added to your common.js or vector.js, works well for me. Click Edit on an article, then click "Find dups" in the Tools list on the left sidebar. – Jonesey95 (talk) 19:39, 28 October 2014 (UTC)
 * I am working on a solution for unnamed parameters (e.g., ), but it will take some time. Frietjes (talk) 19:43, 28 October 2014 (UTC)
 * All of these are fixed as of this time stamp. Nice work, . – Jonesey95 (talk) 19:57, 28 October 2014 (UTC)
 * added some support for unnamed parameters. Frietjes (talk) 20:23, 28 October 2014 (UTC)
 * moved the script to a better name and started some documentation at User:Frietjes/findargdups. feel free to improve the documentation, suggest improvements, or report bugs. Frietjes (talk) 23:44, 28 October 2014 (UTC)

Patterns to search for (using the new beta search)
It is taking a while for articles and templates to show up in this tracking category. Using the beta search, I have been able to find many templates that contain errors but have not yet made it into the category. Searching for this pattern found hundreds of music group templates:

It returns a few false positives, but not many.

For some reason, fixing all of the templates that it finds and then running the search again gives another batch of new results.

Similar searches for common patterns like  should yield similar results. These searches, combined with some clever AWB coding, could help us fix many articles and templates in this category. – Jonesey95 (talk) 01:56, 29 October 2014 (UTC)
 * The first search turned up mostly false positives for me. The trouble is that it can't tell if the duplicate  is in a subtemplate or not. Maybe I was just unlucky, though - I only tried about eight templates or so. — Mr. Stradivarius  ♪ talk ♪ 05:44, 29 October 2014 (UTC)
 * Luck is definitely part of it (I get different results with every search, which is odd), but I fixed a few hundred of these templates yesterday, so it looks like there aren't many left. – Jonesey95 (talk) 14:26, 29 October 2014 (UTC)

Not many left? It shows 62,000 now. Is there any way to make automated (bot) repairs? The few I've fixed did not really effect the display of the article at all. Wbm1058 (talk) 00:17, 1 November 2014 (UTC)
 * I think Jonesey95 is talking about the number of templates in the category, not the total number of pages in it. As for bot repairs, I think you could use a bot to remove named parameters where the value is identical (apart from surrounding whitespace). Would there be any situation in which a fix like this might remove useful information? — Mr. Stradivarius  ♪ talk ♪ 01:43, 1 November 2014 (UTC)
 * Where two parameters are absolutely identical in name and value, removing either one of them will work to get the page out of the cat, and will not change how the page is otherwise rendered. However, I have come across a few cases of this where one of them is probably a typo: e.g. in a sports match there might be Foo United2Bar Rangers2 - the second one is probably intended to be 2 but might just be 1. If there's a source provided, I check that to see what the score was. -- Red rose64 (talk) 13:49, 1 November 2014 (UTC)
 * It should be safe to remove the first of two identical parameters if the first parameter has an empty value. If I were programming a bot, I would want to avoid false positives like the example above, however, and stick to cases where a known problem has been identified and has a known solution that should be free of false positives. Unfortunately, I am not a programmer. I'm happy to help identify bot-fixable problems, however, for a bot programmer. – Jonesey95 (talk) 04:56, 3 November 2014 (UTC)
 * Ok, how about this specification for a bot:
 * The bot loops through pages in this category.
 * For each page, it finds all templates with duplicate named parameters.
 * If all the duplicate named parameters contain only whitespace (no wikimarkup such as double or triple braces, noinclude/includeonly tags, etc.) then it removes all but the first duplicate parameter for each template.
 * This would avoid the problem that Redrose64 outlines above, and it would stop the bot from editing pages that would need to be checked by humans anyway. What do people think? Also, what should we do about duplicate parameters that only contain HTML comments? I think they should probably be treated as whitespace for the purpose of a bot, but I'm open to persuasion if there's a good reason to keep them. (If there's one blank parameter and one parameter with an HTML comment, we should probably keep the parameter with the comment rather than the blank one, however, regardless of its position.) — Mr. Stradivarius  ♪ talk ♪ 16:29, 3 November 2014 (UTC)
 * If we're doing anything automatically, we should always keep the last parameter rather than the first (since the last one "wins" anyway), so that in the event that there is some subtle issue with whitespace (or something), we can be sure that it still won't result in a change to the page's display. Jackmcbarn (talk) 16:34, 3 November 2014 (UTC)
 * Yes, remove the first of the empty duplicate parameters.
 * Some of the logic that 's script uses may be usable for finding duplicate parameters. – Jonesey95 (talk) 23:20, 3 November 2014 (UTC)
 * I think Plastikspork could probably dispatch a bot to do this. SporkBot has been dispatched before to cleanup/rename parameters in infobox templates, and the logic here seems pretty simple in comparison. Frietjes (talk) 23:23, 3 November 2014 (UTC)

Here's another thought - how about if there is a duplicate parameter pair where the first value is blank, and the second value is non-blank? (i.e. .) Would it be safe to remove the first parameter by bot? — Mr. Stradivarius  ♪ talk ♪ 05:33, 4 November 2014 (UTC)
 * Yes, I should think so. -- Red rose64 (talk) 11:12, 4 November 2014 (UTC)
 * Not by a bot, but an AWB user checking each edit should be able to do this safely using the same code. This situation would be subject to the problem described above, Foo Unitedscore1Bar Rangers2, where the second score1 should be score2. – Jonesey95 (talk) 14:55, 4 November 2014 (UTC)
 * Filed this BRFA. Note that I will have the bot generate a log of all replacements so you can quickly scan to see if you want to try to re-correct any by hand.  All feedback is welcome.  Thanks! Plastikspork ―Œ (talk)  22:47, 15 November 2014 (UTC)
 * Some of the duplicates were caused by AWB in the first place. Have a look at [//en.wikipedia.org/w/index.php?title=Special:Contributions/Gadget850&namespace=6&offset=20121002193000 these edits] by from two years ago. In some cases, I found that the same param had been added four times - see for example . -- Red rose64 (talk) 23:58, 15 November 2014 (UTC)
 * Mea culpa. I must have had a bad day. --  Gadget850talk 00:44, 16 November 2014 (UTC)

Detection
168607 will add an error message for duplicate parameters; the message is set by MediaWiki:duplicate-args-warning.

Until the error message is added, duplicate parameters can be found using User:Frietjes/findargdups. --  Gadget850talk 01:23, 1 November 2014 (UTC)

Drvlinks
If anyone's puzzling over Template:Drvlinks, just to let you know that I've started a Lua conversion at Module:Drvlinks which I'll finish tomorrow. The problem is that the different link templates involved take the page name in different parameters. It's possible to fix this just with template code, but it requires some duplication of code which I don't think is desirable. Also, with Lua we can check the namespaces from MediaWiki itself rather than putting the namespace names in a long #switch statement. — Mr. Stradivarius  ♪ talk ♪ 16:24, 1 November 2014 (UTC)

Overriding a parameter used intentionally
See template Non-free use rationale logo, used on File:Dragon mob records logo.jpg. I get the impression (from a comment) that this template intentionally uses the override workings (e.g. source). -DePiep (talk) 00:39, 13 November 2014 (UTC)
 * I have fixed that error by commenting the first parameter (since it was not used or displayed), but I found intentional parameter duplication in another template's documentation the other day (I don't see it in the catscan output now; it looks like catscan is looking at an old version of the WP database at the moment).
 * Citation Style 1 templates have a parameter called template doc demo that, when set to, causes the template documentation page in question to be excluded from error tracking categories. See Template:Cite_web for an explanation.
 * Perhaps something similar could be used to allow demonstration of template errors caused by duplicated parameters. This may be especially useful once duplicate arguments start to display error messages. – Jonesey95 (talk) 01:25, 13 November 2014 (UTC)
 * There's not really anything to demonstrate with regard to duplicate arguments, so I'm not sure why that would be necessary. Also, there is no parameter duplication that's ever useful unless one or both of the parameter names are dynamic (in which case, here be dragons anyway). Jackmcbarn (talk) 03:50, 13 November 2014 (UTC)
 * J95, you commented out the 1st parameter in that page. But shouldn't that template be altered? (There is also File:Disc2phone.png &tc., but numbers are low). Is the Upload precess involved? -DePiep (talk) 07:30, 13 November 2014 (UTC)
 * Where there is true duplication of parameter name (regardless of the param value) in a template usage, as in some value something else, two things happen: (i) the value passed in the first one is ignored; (ii) the page is placed in . These effects are built into the MediaWiki software and apply to all pages, they aren't configurable on a per-page basis nor can a "demonstration" option be added.
 * Since neither of these effects can be controlled, the only way to stop them happening at this version is to do something to one or both of the uses Source - whether it be altering it to a different parameter name, commenting it out (with ) or removing the parameter entirely. The template is set up to recognise Website separately from Source, and these two parameters were used thus:   It is clear to me that for File:Dragon mob records logo.jpg as it stood prior to 13 November, all that was basically necessary was to remove the http://www.dragonmob.com although that would have taken it out of the "Required" group, so it would have been cleaner to amend to   Commenting out the duplication may lead others to uncomment again later. -- Red rose64 (talk) 11:46, 13 November 2014 (UTC)
 * I can't think of any plausible reason whatsoever for "OVERRIDE FIELDS" to exist. Was there ever one? Jackmcbarn (talk) 15:47, 13 November 2014 (UTC)
 * is basically how I would have tackled File:Dragon mob records logo.jpg. -- Red rose64 (talk) 16:14, 13 November 2014 (UTC)
 * Rr64: of course, remove or delete or comment the first mentioning is the obvious action for existing cases. But since it was added thrice=systematically, I mentioned it here because I thought we should change the actor doing that. Either we have to change the template, or maybe the Upload process did something. I'm not familiar enough with the upload process, so I left it from this point. -DePiep (talk) 16:40, 13 November 2014 (UTC)
 * The file was uploaded with those parameters in 2008. In some cases, you can change the documentation or the page creation helper for something like this, but I don't think this is one of those cases. I have found a large number of articles about ships with duplicated parameters. Some of them appear to have been created from via the same copy/paste method, possibly by a single person, but unless new templates are being created in the same way, there isn't much we can do now except fix the existing articles. – Jonesey95 (talk) 18:34, 13 November 2014 (UTC)
 * 2008. End of issue then. -DePiep (talk) 19:08, 13 November 2014 (UTC)

A useful search script
I recommend: User:Frietjes/findargdups documents an installable  script to find duplicate arguments in a page. -DePiep (talk) 17:08, 5 December 2014 (UTC)


 * Yes, works great. Without this script, cleanup is virtually impossible. GregorB (talk) 20:30, 12 December 2014 (UTC)
 * This is definitely a great script - I have cleaned up a lot of pages with it already. Stevie is the man!  Talk • Work 17:26, 24 January 2015 (UTC)

Solve problem
How can I delete for this English name category ᠌"Category:Pages_using_duplicate_arguments_in_template_calls" of our Mongolian Wikipedia 1600 pages. (I didn't any formula in namespace. Thank you. Can you help me.--MongolWiki (talk) 14:13, 3 February 2015 (UTC)
 * It appears in English because nobody has yet translated it to Mongolian. If you know the proper translation, you can [ translate it on TranslateWiki]. Note that there is a delay between when you translate it there and when it will appear on the Mongolian Wikipedia. Jackmcbarn (talk) 21:25, 3 February 2015 (UTC)

WPCleaner
Hi, I've added some code in WPCleaner to help fix the problems detected in this category. To activate this detection in WPCleaner, error #524 must be activated in WikiProject Check Wikipedia/Translation (like on frwiki). --NicoV (Talk on frwiki) 10:52, 11 March 2015 (UTC)
 * I've activated the error, so WPCleaner should detect them automatically. --NicoV (Talk on frwiki) 11:00, 11 March 2015 (UTC)

Making it much easier to find these errors
I just got a change merged into Gerrit that will make it much easier to find the source of duplicate argument errors. It's live on the beta cluster now, and it will be live here soon. You can try it by editing and previewing any page in. Jackmcbarn (talk) 19:02, 28 May 2015 (UTC)
 * What should we look for? I just tried a few and saw nothing except that the page was in the category for dups. Jason Quinn (talk) 19:08, 29 May 2015 (UTC)
 * Jason Quinn I wondered also, but try previewing the page ;-) Just under the "Remember that this is only a preview..." --NicoV (Talk on frwiki) 19:45, 29 May 2015 (UTC)


 * Thanks. I missed the whole "by editing" part. Because of "easier to find" I was thinking it would render a message similar to the CS1 errors. It's more of a prevention feature than a spot-to-repair feature although it could be used for the former too. Jason Quinn (talk) 20:00, 29 May 2015 (UTC)


 * Thanks Jackmcbarn ! Do you know when this will be available on wikipedia?
 * It's nice that it works recursively. We almost fixed all the problems on frwiki, it could be useful for a few difficult ones.
 * Would it be possible to have more details on the error message, like what findargdups.js is doing? It's sometimes difficult to find where the problem is with just the template and argument name. --NicoV (Talk on frwiki) 05:43, 3 June 2015 (UTC)
 * It should be live here with June 11th's software update. I'll see what I can do in terms of providing more information. Jackmcbarn (talk) 23:49, 3 June 2015 (UTC)
 * This is excellent news. The size of this category tends to increase relentlessly without a substantial maintenance effort, so only preventing these errors being introduced in the first place will fix the problem. I suggest the error message should provide a link to a help page, which would provide an explanation and a list of tools to help fix the error. What's going to happen when an error is found? I suggest to begin with, if someone attempts to save a page with the error, that this message is displayed instead and the editor offered a chance to fix it, but still permitting the editor to save it on further attempts. Later on, perhaps we could prevent pages with errors being saved at all (obviously not if the error is due to a transcluded template)? Maybe we should be stricter on templates? Thanks for your work on this. --NSH002 (talk) 09:14, 4 June 2015 (UTC)
 * We'll never be able to prevent saving because of this error, due to a lot of template-related edge cases that could end up making it impossible to make any edit. If you want to add a link to it, that can be done by editing MediaWiki:Duplicate-args-warning (which will be a bluelink once the feature arrives here). There's no useful way to be stricter on templates. Jackmcbarn (talk) 15:55, 5 June 2015 (UTC)

This is now live here. Jackmcbarn (talk) 18:24, 11 June 2015 (UTC)

Category flooded by {Wikiproject China} pages
On 27 March 2016 at 07:22 am, the duplicates category had been flooded with more than 25,000 zillion talk-pages, category-talk and file-talk pages by a duplicate parameter "tf 2=" which had been added into protected Template:Wikiproject_China (see: dif4201), without testing for duplicates beforehand. The template was fixed to remove the duplicate "tf 2=" almost 4 hours later, at 11:09, 27 March 2016. Any stuck pages can be cleared by null-edit (edit SAVE with no changes). This incident emphasizes the danger of editing a mega-template without prior intense, rigorous testing. // Within 4 hours, over 20,000 pages had delinked the category, to delink almost all extra pages 6 hours after the template was fixed. -Wikid77 (talk) 11:35/15:33, 27 March 2016 (UTC)

Category flooded by unseen cause
On 16 April 2016 by 11:00 am, the duplicates category had been flooded with more than 10,000 articles and talk-pages or user-talk pages by some unseen cause which did not show duplicate parameters during edit-preview, nor in menu option Findups. -Wikid77 (talk) 16:45, 16 April 2016 (UTC)
 * Infobox political party was changed about four hours ago. That change introduced duplicate parameters. I have reverted those changes. It will take a while for the articles to be purged from the category. – Jonesey95 (talk) 19:39, 16 April 2016 (UTC)

Embedded pipes
Hoping this might help the next person out; I have a template which accepts inline code blocks, nested pipes in the parameter data causes this check to get tripped but does not result in the "this is why" in red at the top. Using  in place of pipes in the data payload to the template fixed up the issue, this tidbit is buried on the Help:Extension:ParserFunctions page under "Escaping pipe characters in tables". troyengel (talk) 01:38, 14 February 2017 (UTC)

Ireland
The current flood of mostly sporting titles is because of a duplicate argument at Country data Republic of Ireland, now fixed. Flood will subside over time, the doves will soon return to report sighting of land. - X201 (talk) 08:11, 28 September 2017 (UTC)

Articles with no apparent error
The current flood of articles with no apparent template error is caused by a now fixed error at Country data United States. It will probably take 24 hours for it to work its way through the system. - X201 (talk) 12:05, 12 February 2018 (UTC)


 * Only 144 pages in the cat atm fyi.  ~ Tom.Reding (talk ⋅dgaf)  13:37, 12 February 2018 (UTC)
 * Good, looks like its dropping. - X201 (talk) 14:05, 12 February 2018 (UTC)
 * I null edited all. Now there are 39 pages. – Jonesey95 (talk) 15:20, 12 February 2018 (UTC)