Wikipedia:Bots/Requests for approval/NihlusBOT 7
- 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.
Operator: Nihlus (talk · contribs · SUL · edit count · logs · page moves · block log · rights log · ANI search)
Time filed: 22:42, Friday, October 27, 2017 (UTC)
Automatic, Supervised, or Manual: automatic
Programming language(s): AWB
Source code available: AWB
Function overview: Remove useless size/thumb/caption parameters from infobox/template image or file housing parameters, i.e. |300px
, which are forms of Unknown parameters
Links to relevant discussions (where appropriate): Wikipedia:Bot requests/Archive 75#Infobox image cleanup
Edit period(s): Once a month
Estimated number of pages affected: 4,405
Exclusion compliant (Yes/No): Yes
Already has a bot flag (Yes/No): Yes
Function details: It will be finding (\|\s*(logo|image|screenshot|race_logo|track map)\s*=\s*)(File:|Image:)?([^\[\||<\n]*)((\|\s*\d{1,4}px(\?)?|\|\s*thumb))((\|\s*\d{1,4}px(\?)?|\|\s*thumb))?(?(?=\|[A-z]*\s*=)|(?(?=\|(\w*\W*)*)(\|[^\|\n]*)?)?)
and replacing it with $1$4
. See examples here.
Discussion
editComment: Have you considered removing "|thumb" as well? It is pretty common. – Jonesey95 (talk) 23:15, 27 October 2017 (UTC)[reply]
- @Jonesey95: Right when I finished spending some time updating it further. :) Right now it will catch "|300px|thumb" but not "|thumb" by itself. I'll have to either expand that regex or add a second one. Nihlus 23:19, 27 October 2017 (UTC)[reply]
- Well, that was relatively easy. It will catch these now. See the updated examples. Nihlus 23:22, 27 October 2017 (UTC)[reply]
- Sorry but how are these invalid parameters. When I insert an image, I used 400px|thumb. See tests on the right hand side. — Preceding unsigned comment added by Cyberpower678 (talk • contribs)
[[File:Test.png|200px|thumb|right|test]]
[[File:Test.png|300px|right|test]]
- Please sign your posts with four tildes (~). These parameters are invalid in infoboxes when there are no square brackets around them. See this edit for an example that removes unsupported unnamed parameters in an infobox. – Jonesey95 (talk) 02:02, 28 October 2017 (UTC)[reply]
- @Cyberpower678: Images in most infoboxes are supported by Module:InfoboxImage with
| image = {{#invoke:InfoboxImage|InfoboxImage |image={{{image|}}} |size={{{image_size|{{{image size|}}}}}} |sizedefault=frameless |upright=1 |alt={{{alt|}}} |border={{{border|yes}}} }}
. Additional information that isn't assigned to one of those parameters will have no impact on the image displayed and will actually put it in the category mentioned above as having an invalid parameter (it reads them as parameter 1 or 2). Nihlus 02:16, 28 October 2017 (UTC)[reply]- Oh I misread the function details. I thought we are talking about images not infoboxes.—CYBERPOWER (Trick or Treat) 18:14, 28 October 2017 (UTC)[reply]
- @Cyberpower678: Images in most infoboxes are supported by Module:InfoboxImage with
- Approved for trial (50 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete.—CYBERPOWER (Trick or Treat) 18:14, 28 October 2017 (UTC)[reply]
- Trial complete. @Cyberpower678: See here. Only issue with with templates that inexplicably had
|image=|150px?
within the template. The code has been fixed and the examples have been updated to catch these cases. I have also fixed the ones that were resolved fully. Nihlus 18:25, 30 October 2017 (UTC)[reply]
- Trial complete. @Cyberpower678: See here. Only issue with with templates that inexplicably had
@Cyberpower678: I forgot to sign the last one so the notification didn't go through. Nihlus 18:31, 3 November 2017 (UTC)[reply]
{{BAGAssistanceNeeded}}
Anyone? Nihlus 19:56, 5 November 2017 (UTC)[reply]
- Approved.—CYBERPOWER (Chat) 23:04, 5 November 2017 (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.