Reminder to myself to clean up files affected by T121097 and uploaded to Commons with 'null' as the author, after that bug is fixed and the fix deployed.
Description
Description
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | matmarex | T122064 Clean up files uploaded with 'null' as the author | |||
Resolved | matmarex | T121097 Cross-wiki-upload adds "null" as author |
Event Timeline
Comment Actions
I have corrected the problematic uploads on Commons: https://commons.wikimedia.org/w/index.php?title=Special:Contributions/Matma_Rex&dir=prev&offset=20160119213820&limit=250&target=Matma+Rex (exactly 250, as it happens).
Seven more files (https://commons.wikimedia.org/w/index.php?title=Special:WhatLinksHere/User:Null&namespace=6) appear to be affected by some similar bugs in other tools. They're all pretty old though.
Comment Actions
# coding: utf-8 require 'sunflower' s = Sunflower.new 'commons' #s.login 'Matma Rex', gets.strip s.summary = 'fixing "null" author for cross-wiki uploads, see [[phab:T121097]]' l = s.make_list 'whatlinkshere', 'User:Null' puts l.length l.each do |t| next unless t.start_with? 'File:' logs = s.API action: 'query', list: 'logevents', letype: 'upload', letitle: t next if logs['query']['logevents'].empty? if logs['query']['logevents'][0]['comment'].start_with? 'Cross-wiki upload from' author = logs['query']['logevents'][0]['user'] next if !author || author.empty? page = s.page t next unless page.text.sub! '[[User:null|null]]', "[[User:#{author}|#{author}]]" if page.save puts "Fixed: #{t} -> #{author}" end end end