From: MusikAnimal Date: Tue, 19 Sep 2017 22:11:28 +0000 (-0400) Subject: Don't attempt to copy to ip_changes in PageArchive class. X-Git-Tag: 1.31.0-rc.0~2034 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=5e7fd24297cb886f2b59a1b9c83db7e2581f31fe;p=lhc%2Fweb%2Fwiklou.git Don't attempt to copy to ip_changes in PageArchive class. 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 --- diff --git a/includes/page/PageArchive.php b/includes/page/PageArchive.php index c98d4f739d..af936cc730 100644 --- a/includes/page/PageArchive.php +++ b/includes/page/PageArchive.php @@ -734,18 +734,9 @@ class PageArchive { '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',