X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Forphans.php;h=7acf6d8279dc41496cd06f3b040b251f2128e454;hb=a7e2b91b2c72f3522a7a9c3c957a43309e70b92e;hp=54a68aeb36216ba69f62e68ff0b434fca1c09b38;hpb=1029b36698d38ae4712749e5baaa9505f1426447;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/orphans.php b/maintenance/orphans.php index 54a68aeb36..7acf6d8279 100644 --- a/maintenance/orphans.php +++ b/maintenance/orphans.php @@ -75,23 +75,25 @@ class Orphans extends Maintenance { */ private function checkOrphans( $fix ) { $dbw = $this->getDB( DB_MASTER ); - $commentStore = new CommentStore( 'rev_comment' ); + $commentStore = CommentStore::getStore(); if ( $fix ) { $this->lockTables( $dbw ); } - $commentQuery = $commentStore->getJoin(); + $commentQuery = $commentStore->getJoin( 'rev_comment' ); + $actorQuery = ActorMigration::newMigration()->getJoin( 'rev_user' ); $this->output( "Checking for orphan revision table entries... " . "(this may take a while on a large wiki)\n" ); $result = $dbw->select( - [ 'revision', 'page' ] + $commentQuery['tables'], - [ 'rev_id', 'rev_page', 'rev_timestamp', 'rev_user_text' ] + $commentQuery['fields'], + [ 'revision', 'page' ] + $commentQuery['tables'] + $actorQuery['tables'], + [ 'rev_id', 'rev_page', 'rev_timestamp' ] + $commentQuery['fields'] + $actorQuery['fields'], [ 'page_id' => null ], __METHOD__, [], [ 'page' => [ 'LEFT JOIN', [ 'rev_page=page_id' ] ] ] + $commentQuery['joins'] + + $actorQuery['joins'] ); $orphans = $result->numRows(); if ( $orphans > 0 ) { @@ -104,7 +106,7 @@ class Orphans extends Maintenance { ) ); foreach ( $result as $row ) { - $comment = $commentStore->getComment( $row )->text; + $comment = $commentStore->getComment( 'rev_comment', $row )->text; if ( $comment !== '' ) { $comment = '(' . $wgContLang->truncate( $comment, 40 ) . ')'; } @@ -252,5 +254,5 @@ class Orphans extends Maintenance { } } -$maintClass = "Orphans"; +$maintClass = Orphans::class; require_once RUN_MAINTENANCE_IF_MAIN;