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 Symbol keep vote.svgSymbol support vote.svg Speedily Approved.

MadmanBot 10
Operator:

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. This bug makes recently moved files appear to be orphaned and leads to them being speedily deleted. This task will be deprecated when is live on the English Wikipedia.

Discussion
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. &mdash; madman 01:56, 29 January 2012 (UTC)
 * The relevant bug is . Doesn't seem likely to be fixed any time soon. Edits look good to me. Anomie⚔ 03:31, 29 January 2012 (UTC)
 * Interesting. I'm unable to reproduce that bug on my local 1.19alpha installation. Is it specific to Wikipedia? &mdash; madman 07:29, 29 January 2012 (UTC)
 * Hey, you're right. Seems to have been fixed as of . But the 1.18wmf1 branch still has a bug (which seems to have been fixed in ) 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 [[Image:Sharkey.jpg|10px]] 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)

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. &mdash; madman 18:10, 29 January 2012 (UTC)
 * 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 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)
 * I've rewritten the code and function details and am just waiting for approval. :) &mdash; madman 19:00, 29 January 2012 (UTC)
 * I think I see a few bugs in your code:  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   would screw up all the pages if   doesn't override it. Anomie⚔ 01:03, 30 January 2012 (UTC)
 * I certainly don't mind; that's what's what the BAG's for: a second set of eyes! Yes,  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! &mdash; madman 02:15, 30 January 2012 (UTC)
 * 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)
 * 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.