r91366 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91365‎ | r91366 | r91367 >
Date:18:50, 2 July 2011
Author:aaron
Status:ok
Tags:
Comment:
* Use rev_timestamp instead of rev_id range condition for reject revision list
* (Bug 26109) Don't list users who haven't actually changed the page in reject summary (also on the UI list)
Modified paths:
  • /trunk/extensions/FlaggedRevs/presentation/RejectConfirmationFormUI.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/presentation/language/RevisionReview.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/presentation/language/RevisionReview.i18n.php
@@ -34,6 +34,7 @@
3535 'review_cannot_undo' => 'Cannot undo these changes because further pending edits changed the same areas.',
3636 'review_cannot_reject' => 'Cannot reject these changes because someone already accepted some (or all) of the edits.',
3737 'review_reject_excessive' => 'Cannot reject this many edits at once.',
 38+ 'review_reject_nulledits' => 'Cannot reject these changes because all the revisions are all null edits.',
3839
3940 'revreview-check-flag-p' => 'Accept this version (includes $1 pending {{PLURAL:$1|change|changes}})',
4041 'revreview-check-flag-p-title' => 'Accept the result of the pending changes and the changes you made here. Use this only if you have already seen the entire pending changes diff.',
@@ -85,10 +86,10 @@
8687 'revreview-reject-summary' => 'Summary:',
8788 'revreview-reject-confirm' => 'Reject these changes',
8889 'revreview-reject-cancel' => 'Cancel',
89 - 'revreview-reject-summary-cur' => 'Rejected the last {{PLURAL:$1|change|$1 changes}} (by $2) and restored revision $3 by $4',
90 - 'revreview-reject-summary-old' => 'Rejected the first {{PLURAL:$1|change|$1 changes}} (by $2) that followed revision $3 by $4',
91 - 'revreview-reject-summary-cur-short' => 'Rejected the last {{PLURAL:$1|change|$1 changes}} and restored revision $2 by $3',
92 - 'revreview-reject-summary-old-short' => 'Rejected the first {{PLURAL:$1|change|$1 changes}} that followed revision $2 by $3',
 90+ 'revreview-reject-summary-cur' => 'Rejected the last {{PLURAL:$1|text change|$1 text changes}} (by $2) and restored revision $3 by $4',
 91+ 'revreview-reject-summary-old' => 'Rejected the first {{PLURAL:$1|text change|$1 text changes}} (by $2) that followed revision $3 by $4',
 92+ 'revreview-reject-summary-cur-short' => 'Rejected the last {{PLURAL:$1|text change|$1 text changes}} and restored revision $2 by $3',
 93+ 'revreview-reject-summary-old-short' => 'Rejected the first {{PLURAL:$1|text change|$1 text changes}} that followed revision $2 by $3',
9394 'revreview-reject-usercount' => '{{PLURAL:$1|one user|$1 users}}',
9495
9596 'revreview-tt-flag' => 'Accept this revision by marking it as "checked"',
Index: trunk/extensions/FlaggedRevs/presentation/RejectConfirmationFormUI.php
@@ -37,11 +37,13 @@
3838 Revision::selectFields(),
3939 array(
4040 'rev_page' => $oldRev->getPage(),
41 - 'rev_id > ' . $dbr->addQuotes( $oldRev->getId() ),
42 - 'rev_id <= ' . $dbr->addQuotes( $newRev->getId() )
 41+ 'rev_timestamp > ' . $dbr->addQuotes(
 42+ $dbr->timestamp( $oldRev->getTimestamp() ) ),
 43+ 'rev_timestamp <= ' . $dbr->addQuotes(
 44+ $dbr->timestamp( $newRev->getTimestamp() ) )
4345 ),
4446 __METHOD__,
45 - array( 'LIMIT' => 251 ) // sanity check
 47+ array( 'ORDER BY' => 'rev_timestamp ASC', 'LIMIT' => 251 ) // sanity check
4648 );
4749 if ( !$dbr->numRows( $res ) ) {
4850 return array( '', 'review_bad_oldid' );
@@ -49,17 +51,26 @@
5052 return array( '', 'review_reject_excessive' );
5153 }
5254
 55+ $contribs = SpecialPage::getTitleFor( 'Contributions' )->getPrefixedText();
 56+
 57+ $lastTextId = 0;
5358 $rejectIds = $rejectAuthors = array();
54 - $contribs = SpecialPage::getTitleFor( 'Contributions' )->getPrefixedText();
5559 foreach ( $res as $row ) {
5660 $rev = new Revision( $row );
57 - $rejectIds[] = $rev->getId();
58 - $rejectAuthors[] = $rev->isDeleted( Revision::DELETED_USER )
59 - ? wfMsg( 'rev-deleted-user' )
60 - : "[[{$contribs}/{$rev->getUserText()}|{$rev->getUserText()}]]";
 61+ if ( $rev->getTextId() != $lastTextId ) { // skip null edits
 62+ $rejectIds[] = $rev->getId();
 63+ $rejectAuthors[] = $rev->isDeleted( Revision::DELETED_USER )
 64+ ? wfMsg( 'rev-deleted-user' )
 65+ : "[[{$contribs}/{$rev->getUserText()}|{$rev->getUserText()}]]";
 66+ }
 67+ $lastTextId = $rev->getTextId();
6168 }
6269 $rejectAuthors = array_values( array_unique( $rejectAuthors ) );
6370
 71+ if ( !$rejectIds ) { // all null edits? (this shouldn't happen)
 72+ return array( '', 'review_reject_nulledits' );
 73+ }
 74+
6475 // List of revisions being undone...
6576 $form .= wfMsgExt( 'revreview-reject-text-list', 'parseinline',
6677 $wgLang->formatNum( count( $rejectIds ) ), $oldRev->getTitle()->getPrefixedText() );

Status & tagging log