Replace deprecated IDatabase::fetchObject
Bug: T286694 Change-Id: I78ae801c9fec3de0495f355b90edaac703faa169
This commit is contained in:
parent
f9aa4a74b3
commit
c68abe1641
1 changed files with 3 additions and 6 deletions
|
@ -41,7 +41,7 @@ class ContributionScores extends IncludableSpecialPage {
|
||||||
|
|
||||||
$revWhere = ActorMigration::newMigration()->getWhere( $dbr, 'rev_user', $user );
|
$revWhere = ActorMigration::newMigration()->getWhere( $dbr, 'rev_user', $user );
|
||||||
if ( $metric == 'score' ) {
|
if ( $metric == 'score' ) {
|
||||||
$res = $dbr->select(
|
$row = $dbr->selectRow(
|
||||||
[ 'revision' ] + $revWhere['tables'],
|
[ 'revision' ] + $revWhere['tables'],
|
||||||
[ 'wiki_rank' => "COUNT(DISTINCT rev_page)+SQRT($revVar-COUNT(DISTINCT rev_page))*2" ],
|
[ 'wiki_rank' => "COUNT(DISTINCT rev_page)+SQRT($revVar-COUNT(DISTINCT rev_page))*2" ],
|
||||||
$revWhere['conds'],
|
$revWhere['conds'],
|
||||||
|
@ -49,10 +49,9 @@ class ContributionScores extends IncludableSpecialPage {
|
||||||
[],
|
[],
|
||||||
$revWhere['joins']
|
$revWhere['joins']
|
||||||
);
|
);
|
||||||
$row = $dbr->fetchObject( $res );
|
|
||||||
$output = $wgLang->formatNum( round( $row->wiki_rank, 0 ) );
|
$output = $wgLang->formatNum( round( $row->wiki_rank, 0 ) );
|
||||||
} elseif ( $metric == 'changes' ) {
|
} elseif ( $metric == 'changes' ) {
|
||||||
$res = $dbr->select(
|
$row = $dbr->selectRow(
|
||||||
[ 'revision' ] + $revWhere['tables'],
|
[ 'revision' ] + $revWhere['tables'],
|
||||||
[ 'rev_count' => $revVar ],
|
[ 'rev_count' => $revVar ],
|
||||||
$revWhere['conds'],
|
$revWhere['conds'],
|
||||||
|
@ -60,10 +59,9 @@ class ContributionScores extends IncludableSpecialPage {
|
||||||
[],
|
[],
|
||||||
$revWhere['joins']
|
$revWhere['joins']
|
||||||
);
|
);
|
||||||
$row = $dbr->fetchObject( $res );
|
|
||||||
$output = $wgLang->formatNum( $row->rev_count );
|
$output = $wgLang->formatNum( $row->rev_count );
|
||||||
} elseif ( $metric == 'pages' ) {
|
} elseif ( $metric == 'pages' ) {
|
||||||
$res = $dbr->select(
|
$row = $dbr->selectRow(
|
||||||
[ 'revision' ] + $revWhere['tables'],
|
[ 'revision' ] + $revWhere['tables'],
|
||||||
[ 'page_count' => 'COUNT(DISTINCT rev_page)' ],
|
[ 'page_count' => 'COUNT(DISTINCT rev_page)' ],
|
||||||
$revWhere['conds'],
|
$revWhere['conds'],
|
||||||
|
@ -71,7 +69,6 @@ class ContributionScores extends IncludableSpecialPage {
|
||||||
[],
|
[],
|
||||||
$revWhere['joins']
|
$revWhere['joins']
|
||||||
);
|
);
|
||||||
$row = $dbr->fetchObject( $res );
|
|
||||||
$output = $wgLang->formatNum( $row->page_count );
|
$output = $wgLang->formatNum( $row->page_count );
|
||||||
} else {
|
} else {
|
||||||
$output = wfMessage( 'contributionscores-invalidmetric' )->text();
|
$output = wfMessage( 'contributionscores-invalidmetric' )->text();
|
||||||
|
|
Loading…
Add table
Reference in a new issue