Merge "Update for deprecation of selectFields() methods"

This commit is contained in:
jenkins-bot 2017-10-31 16:08:46 +00:00 committed by Gerrit Code Review
commit f5536f964e
4 changed files with 24 additions and 23 deletions

View file

@ -2187,10 +2187,7 @@ class AbuseFilter {
$vars->setVar( 'ACTION', 'delete' );
if ( class_exists( CommentStore::class ) ) {
$vars->setVar( 'SUMMARY', CommentStore::newKey( 'rc_comment' )
// $row comes from RecentChange::selectFields()
->getCommentLegacy( wfGetDB( DB_REPLICA ), $row )->text
);
$vars->setVar( 'SUMMARY', CommentStore::newKey( 'rc_comment' )->getComment( $row )->text );
} else {
$vars->setVar( 'SUMMARY', $row->rc_comment );
}
@ -2220,10 +2217,7 @@ class AbuseFilter {
$vars->setVar( 'ACTION', 'edit' );
if ( class_exists( CommentStore::class ) ) {
$vars->setVar( 'SUMMARY', CommentStore::newKey( 'rc_comment' )
// $row comes from RecentChange::selectFields()
->getCommentLegacy( wfGetDB( DB_REPLICA ), $row )->text
);
$vars->setVar( 'SUMMARY', CommentStore::newKey( 'rc_comment' )->getComment( $row )->text );
} else {
$vars->setVar( 'SUMMARY', $row->rc_comment );
}
@ -2267,10 +2261,7 @@ class AbuseFilter {
);
if ( class_exists( CommentStore::class ) ) {
$vars->setVar( 'SUMMARY', CommentStore::newKey( 'rc_comment' )
// $row comes from RecentChange::selectFields()
->getCommentLegacy( wfGetDB( DB_REPLICA ), $row )->text
);
$vars->setVar( 'SUMMARY', CommentStore::newKey( 'rc_comment' )->getComment( $row )->text );
} else {
$vars->setVar( 'SUMMARY', $row->rc_comment );
}

View file

@ -77,11 +77,14 @@ class AbuseFilterViewExamine extends AbuseFilterView {
function showExaminerForRC( $rcid ) {
// Get data
$dbr = wfGetDB( DB_REPLICA );
$rcQuery = RecentChange::getQueryInfo();
$row = $dbr->selectRow(
'recentchanges',
RecentChange::selectFields(),
$rcQuery['tables'],
$rcQuery['fields'],
[ 'rc_id' => $rcid ],
__METHOD__
__METHOD__,
[],
$rcQuery['joins']
);
$out = $this->getOutput();
if ( !$row ) {
@ -247,11 +250,13 @@ class AbuseFilterExaminePager extends ReverseChronologicalPager {
$conds[] = $this->mPage->buildTestConditions( $dbr );
$rcQuery = RecentChange::getQueryInfo();
$info = [
'tables' => 'recentchanges',
'fields' => RecentChange::selectFields(),
'tables' => $rcQuery['tables'],
'fields' => $rcQuery['fields'],
'conds' => array_filter( $conds ),
'options' => [ 'ORDER BY' => 'rc_timestamp DESC' ],
'join_conds' => $rcQuery['joins'],
];
return $info;

View file

@ -119,12 +119,14 @@ class AbuseFilterViewTestBatch extends AbuseFilterView {
$changesList = new AbuseFilterChangesList( $this->getSkin() );
$output = $changesList->beginRecentChangesList();
$rcQuery = RecentChange::getQueryInfo();
$res = $dbr->select(
'recentchanges',
RecentChange::selectFields(),
$rcQuery['tables'],
$rcQuery['fields'],
array_filter( $conds ),
__METHOD__,
[ 'LIMIT' => self::$mChangeLimit, 'ORDER BY' => 'rc_timestamp desc' ]
[ 'LIMIT' => self::$mChangeLimit, 'ORDER BY' => 'rc_timestamp desc' ],
$rcQuery['joins']
);
$counter = 1;

View file

@ -19,11 +19,14 @@ class ApiAbuseFilterCheckMatch extends ApiBase {
}
} elseif ( $params['rcid'] ) {
$dbr = wfGetDB( DB_REPLICA );
$rcQuery = RecentChange::getQueryInfo();
$row = $dbr->selectRow(
'recentchanges',
RecentChange::selectFields(),
$rcQuery['tables'],
$rcQuery['fields'],
[ 'rc_id' => $params['rcid'] ],
__METHOD__
__METHOD__,
[],
$rcQuery['joins']
);
if ( !$row ) {