}
function getQueryInfo() {
- list( $index, $userCond ) = $this->getUserCond();
+ $userCond = [
+ // ->getJoin() below takes care of any joins needed
+ ActorMigration::newMigration()->getWhere(
+ wfGetDB( DB_REPLICA ), 'ar_user', User::newFromName( $this->target, false ), false
+ )['conds']
+ ];
$conds = array_merge( $userCond, $this->getNamespaceCond() );
$user = $this->getUser();
// Paranoia: avoid brute force searches (T19792)
' != ' . Revision::SUPPRESSED_USER;
}
- $commentQuery = CommentStore::newKey( 'ar_comment' )->getJoin();
+ $commentQuery = CommentStore::getStore()->getJoin( 'ar_comment' );
+ $actorQuery = ActorMigration::newMigration()->getJoin( 'ar_user' );
return [
- 'tables' => [ 'archive' ] + $commentQuery['tables'],
+ 'tables' => [ 'archive' ] + $commentQuery['tables'] + $actorQuery['tables'],
'fields' => [
'ar_rev_id', 'ar_namespace', 'ar_title', 'ar_timestamp',
- 'ar_minor_edit', 'ar_user', 'ar_user_text', 'ar_deleted'
- ] + $commentQuery['fields'],
+ 'ar_minor_edit', 'ar_deleted'
+ ] + $commentQuery['fields'] + $actorQuery['fields'],
'conds' => $conds,
- 'options' => [ 'USE INDEX' => [ 'archive' => $index ] ],
- 'join_conds' => $commentQuery['joins'],
+ 'options' => [],
+ 'join_conds' => $commentQuery['joins'] + $actorQuery['joins'],
];
}
return new FakeResultWrapper( $result );
}
- function getUserCond() {
- $condition = [];
-
- $condition['ar_user_text'] = $this->target;
- $index = 'ar_usertext_timestamp';
-
- return [ $index, $condition ];
- }
-
function getIndexField() {
return 'ar_timestamp';
}
* we're definitely dealing with revision data and we may proceed, if not, we'll leave it
* to extensions to subscribe to the hook to parse the row.
*/
- MediaWiki\suppressWarnings();
+ Wikimedia\suppressWarnings();
try {
$rev = Revision::newFromArchiveRow( $row );
$validRevision = (bool)$rev->getId();
} catch ( Exception $e ) {
$validRevision = false;
}
- MediaWiki\restoreWarnings();
+ Wikimedia\restoreWarnings();
if ( $validRevision ) {
$attribs['data-mw-revid'] = $rev->getId();
$rev = new Revision( [
'title' => $page,
'id' => $row->ar_rev_id,
- 'comment' => CommentStore::newKey( 'ar_comment' )->getComment( $row )->text,
+ 'comment' => CommentStore::getStore()->getComment( 'ar_comment', $row )->text,
'user' => $row->ar_user,
'user_text' => $row->ar_user_text,
+ 'actor' => isset( $row->ar_actor ) ? $row->ar_actor : null,
'timestamp' => $row->ar_timestamp,
'minor_edit' => $row->ar_minor_edit,
'deleted' => $row->ar_deleted,