mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-24 14:13:54 +00:00
Merge "Update for deprecation of selectFields() methods"
This commit is contained in:
commit
f5536f964e
|
@ -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 );
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 ) {
|
||||
|
|
Loading…
Reference in a new issue