Anomie has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/374860 )
Change subject: Use CommentStore to access core comment fields
......................................................................
Use CommentStore to access core comment fields
See core change Ic3a434c0.
Bug: T166732
Change-Id: Ib5d50c1e136f7a98219c208f92b73b0e0b2717ba
---
M maintenance/updateAutoPromote.php
1 file changed, 11 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FlaggedRevs
refs/changes/60/374860/1
diff --git a/maintenance/updateAutoPromote.php
b/maintenance/updateAutoPromote.php
index dfc0ad3..5ad34a1 100644
--- a/maintenance/updateAutoPromote.php
+++ b/maintenance/updateAutoPromote.php
@@ -22,6 +22,7 @@
global $wgFlaggedRevsAutopromote;
$this->output( "Populating and updating flaggedrevs_promote
table\n" );
+ $commentQuery = CommentStore::newKey( 'rev_comment'
)->getJoin();
$dbr = wfGetDB( DB_SLAVE );
$dbw = wfGetDB( DB_MASTER );
$start = $dbr->selectField( 'user', 'MIN(user_id)', false,
__METHOD__ );
@@ -44,11 +45,17 @@
$p = FRUserCounters::getUserParams(
$user->getId(), FR_FOR_UPDATE );
$oldp = $p;
# Get edit comments used
- $sres = $dbr->select( 'revision', '1',
- [ 'rev_user' => $user->getID(),
- "rev_comment NOT LIKE '/*%*/'"
], // manual comments only
+ $sres = $dbr->select(
+ [ 'revision' ] +
$commentQuery['tables'],
+ '1',
+ [
+ 'rev_user' => $user->getID(),
+ // @todo Should there be a
"rev_comment != ''" here too?
+
$commentQuery['fields']['rev_comment_text'] . " NOT LIKE '/*%*/'", // manual
comments only
+ ],
__METHOD__,
- [ 'LIMIT' => max(
$wgFlaggedRevsAutopromote['editComments'], 500 ) ]
+ [ 'LIMIT' => max(
$wgFlaggedRevsAutopromote['editComments'], 500 ) ],
+ $commentQuery['joins']
);
$p['editComments'] = $dbr->numRows( $sres );
# Get content page edits
--
To view, visit https://gerrit.wikimedia.org/r/374860
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib5d50c1e136f7a98219c208f92b73b0e0b2717ba
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/FlaggedRevs
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits