jenkins-bot has submitted this change and it was merged. (
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
Depends-On: I92954c922514271d774518d6a6c28a01f33c88c2
Change-Id: Ib5d50c1e136f7a98219c208f92b73b0e0b2717ba
---
M business/RevisionReviewForm.php
M maintenance/updateAutoPromote.php
2 files changed, 12 insertions(+), 8 deletions(-)
Approvals:
Legoktm: Looks good to me, approved
jenkins-bot: Verified
Anomie: Looks good to me, approved
diff --git a/business/RevisionReviewForm.php b/business/RevisionReviewForm.php
index f50a537..93452c5 100644
--- a/business/RevisionReviewForm.php
+++ b/business/RevisionReviewForm.php
@@ -271,8 +271,6 @@
* @return mixed (true on success, error string on failure)
*/
public function doSubmit() {
- global $wgContLang;
-
# Double-check permissions
if ( !$this->isAllowed() ) {
return 'review_denied';
@@ -332,8 +330,7 @@
}
$baseRevId = $newRev->isCurrent() ? $oldRev->getId() :
0;
- # Truncate for whole multibyte characters
- $comment = $wgContLang->truncate( $this->getComment(),
255 );
+ $comment = $this->getComment();
# Actually make the edit...
$editStatus = $article->doEditContent(
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: merged
Gerrit-Change-Id: Ib5d50c1e136f7a98219c208f92b73b0e0b2717ba
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/FlaggedRevs
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Brion VIBBER <[email protected]>
Gerrit-Reviewer: Jackmcbarn <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Tim Starling <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits