When a user is blocked with username suppression, the username is suppressed for old revisions of a file, but the current version has the (suppressed) username shown.
To reproduce,
* Upload an image as a user
* Upload a second version of the image
* Login as an admin and block the uploading, selecting "Hide username from edits and lists"
* As a logged out user, view the File page. The username is still visible on the current revision, but not for old revisions.
Example of affected file with a single revision: [[ https://commons.wikimedia.org/wiki/File:Schachboxen1.jpg | Schachboxen1.jpg ]]
Example of affected file with multiple revisions: [[ https://commons.wikimedia.org/wiki/File:Toolse_linnuse_varemed.jpg | Toolse_linnuse_varemed.jpg ]]
== Patches
* {F163752} - add `image.img_deleted`, populate it from `ipblocks`, update `oldimage.oi_deleted`/`filearchive.fa_deleted` based on `ipblocks` to account for past `image` -> `oldimage`/`filearchive` transitions
* {F55438} - support revdel flags on current versions of images
* {F183446} - invalidate image cache when needed
* {F173469} - trigger cache invalidation from CentralAuth global locks
* {F173490} - make image table dump private (patch made against `ariel` branch of `operations/dumps`
* {F173492} - hide username in Labs replicas (patch made against `operations/software`)
== One-time script files for WMF cluster update:
`T90300-add-img_deleted.sql`:
```
ALTER TABLE image ADD img_deleted tinyint unsigned NOT NULL default 0;
```
`T90300-populate-img_deleted.sql`:
```
UPDATE image JOIN ipblocks ON img_user_text = ipb_address
SET img_deleted = img_deleted | 12
WHERE ipb_deleted;
UPDATE oldimage JOIN ipblocks ON oi_user_text = ipb_address
SET oi_deleted = oi_deleted | 12
WHERE ipb_deleted;
UPDATE filearchive JOIN ipblocks ON fa_user_text = ipb_address
SET fa_deleted = fa_deleted | 12
WHERE ipb_deleted;
```
== WMF cluster update plan
# run `foreachdb sql.php /home/tgr/T90300-add-img_deleted.sql`
# apply all patches
# run `foreachdb sql.php /home/tgr/T90300-populate-img_deleted.sql`
# run script via `foreachwiki eval.php` to invalidate cache (if we care enough):
```
$dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( 'image', LocalFile::selectFields(), array( $dbr->bitAnd( 'img_deleted', 12 ) . ' = 12' ), 'T90300' ); foreach ( $res as $row ) { RepoGroup::singleton()->getLocalRepo()->newFileFromRow( $row )->invalidateCache(); }
```
== Notices
* removes public image table dumps (image table will still be available via Tool Labs)