This actually happens in Revision::insertOn, so the code is redundant,
but also shouldn't ever execute because it erroneously was checking
for ar_rev_id=0 and not ar_user=0.
This is sometimes causing errors in production, in the rare cases
where ar_rev_id is NULL, and hence (int)ar_rev_id evaluates to 0.
Change-Id: I35a7310f600a9db683d7dc0e730da8ff31e337a2
'deleted' => $unsuppress ? 0 : $row->ar_deleted
] );
+ // This will also copy the revision to ip_changes if it was an IP edit.
$revision->insertOn( $dbw );
- // Also restore reference to the revision in ip_changes if it was an IP edit.
- if ( (int)$row->ar_rev_id === 0 && IP::isValid( $row->ar_user_text ) ) {
- $ipcRow = [
- 'ipc_rev_id' => $row->ar_rev_id,
- 'ipc_rev_timestamp' => $row->ar_timestamp,
- 'ipc_hex' => IP::toHex( $row->ar_user_text ),
- ];
- $dbw->insert( 'ip_changes', $ipcRow, __METHOD__ );
- }
-
$restored++;
Hooks::run( 'ArticleRevisionUndeleted',