Wikipedia:Bots/Requests for approval/MadmanBot 10
- 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 Speedily Approved.
Operator: Madman (talk · contribs)
Time filed: 23:57, Saturday January 28, 2012 (UTC)
Automatic or Manual: Automatic.
Programming language(s): PHP.
Source code available: Yes.
Function overview: Performs null edits on file redirects.
Links to relevant discussions (where appropriate):
Edit period(s): Daily.
Estimated number of pages affected: All file redirects on the first run, only file redirects that haven't already been touched on subsequent runs.
Exclusion compliant (Y/N): Yes.
Already has a bot flag (Y/N): Yes.
Function details: This task will perform null edits on file redirects in order to address T25002. This bug makes recently moved files appear to be orphaned and leads to them being speedily deleted. This task will be deprecated when r107636 is live on the English Wikipedia.
Discussion
[edit]Performed a semi-automated and supervised trial (all edits confirmed before and after). Results can be seen here. The only mistake was one edit within the User namespace, after which the bot was limited to the article namespace, which was the intent. — madman 01:56, 29 January 2012 (UTC)[reply]
- The relevant bug is T20017. Doesn't seem likely to be fixed any time soon. Edits look good to me. Anomie⚔ 03:31, 29 January 2012 (UTC)[reply]
- Interesting. I'm unable to reproduce that bug on my local 1.19alpha installation. Is it specific to Wikipedia? — madman 07:29, 29 January 2012 (UTC)[reply]
- Hey, you're right. Seems to have been fixed as of r88054. But the 1.18wmf1 branch still has a bug (which seems to have been fixed in r107636) that causes the redirect created by the page move to not be listed in imagelinks. A null edit to the image redirect seems to fix things; for example, here is an image link to Image:Sharkey.jpg; since I already null-edited the redirect, this BRFA does show up at the bottom of File:Lance Sharkey (ca. late 1930s).jpg and in the appropriate API request.
- So I wonder if this bot request should just be changed to "Make a null edit to file redirects that don't show up in the usage list for their target's page". Anomie⚔ 17:06, 29 January 2012 (UTC)[reply]
- Interesting. I'm unable to reproduce that bug on my local 1.19alpha installation. Is it specific to Wikipedia? — madman 07:29, 29 January 2012 (UTC)[reply]
Hmmm. I could do that; it'd certainly cut down the code. It seems like a bit of a hack (null editing a redirect after it's already been created), but maybe that's just my OCD. :p Hopefully the bot will find itself deprecated in the future when yet another code change updates caches and imagelinks correctly when files are redirected in the first place. — madman 18:10, 29 January 2012 (UTC)[reply]
- It is a hack, to work around the bug in updating the metadata on the new redirect when moving files. You'd probably want to run it over all existing file-namespace redirects, and then any new ones that get created. Once r107636 goes live (probably when we get to start testing 1.19), the task will no longer be needed. Anomie⚔ 18:14, 29 January 2012 (UTC)[reply]
- I've rewritten the code and function details and am just waiting for approval. :) — madman 19:00, 29 January 2012 (UTC)[reply]
- I think I see a few bugs in your code:
$parameters['info']
is going to be reset each time through the loop, so it would loop forever were there not only 1308 redirects total in the file namespace. Also, assuming the parameters passed are sent directly to the API, it looks like'text' => 'Automated edit: Performing null edit.'
would screw up all the pages if'appendtext' => ''
doesn't override it. Anomie⚔ 01:03, 30 January 2012 (UTC)[reply]- I certainly don't mind; that's what's what the BAG's for: a second set of eyes! Yes,
$parameters['info']
should be outside the loop and has been moved. And appendtext does override text (I've tested this code), but that was of course meant to be summary. (Not that it matters much anyhow. :p) Thanks, Anomie! — madman 02:15, 30 January 2012 (UTC)[reply]- Speedily Approved. I was tempted to give it for a zero-edit trial, since the null edits wouldn't show up to be reviewed. But let's just go ahead with it. Anomie⚔ 02:38, 30 January 2012 (UTC)[reply]
- I certainly don't mind; that's what's what the BAG's for: a second set of eyes! Yes,
- I think I see a few bugs in your code:
- I've rewritten the code and function details and am just waiting for approval. :) — madman 19:00, 29 January 2012 (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.