Index: trunk/extensions/FlaggedRevs/presentation/language/RevisionReview.i18n.php |
— | — | @@ -34,6 +34,7 @@ |
35 | 35 | 'review_cannot_undo' => 'Cannot undo these changes because further pending edits changed the same areas.', |
36 | 36 | 'review_cannot_reject' => 'Cannot reject these changes because someone already accepted some (or all) of the edits.', |
37 | 37 | '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.', |
38 | 39 | |
39 | 40 | 'revreview-check-flag-p' => 'Accept this version (includes $1 pending {{PLURAL:$1|change|changes}})', |
40 | 41 | '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 @@ |
86 | 87 | 'revreview-reject-summary' => 'Summary:', |
87 | 88 | 'revreview-reject-confirm' => 'Reject these changes', |
88 | 89 | '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', |
93 | 94 | 'revreview-reject-usercount' => '{{PLURAL:$1|one user|$1 users}}', |
94 | 95 | |
95 | 96 | 'revreview-tt-flag' => 'Accept this revision by marking it as "checked"', |
Index: trunk/extensions/FlaggedRevs/presentation/RejectConfirmationFormUI.php |
— | — | @@ -37,11 +37,13 @@ |
38 | 38 | Revision::selectFields(), |
39 | 39 | array( |
40 | 40 | '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() ) ) |
43 | 45 | ), |
44 | 46 | __METHOD__, |
45 | | - array( 'LIMIT' => 251 ) // sanity check |
| 47 | + array( 'ORDER BY' => 'rev_timestamp ASC', 'LIMIT' => 251 ) // sanity check |
46 | 48 | ); |
47 | 49 | if ( !$dbr->numRows( $res ) ) { |
48 | 50 | return array( '', 'review_bad_oldid' ); |
— | — | @@ -49,17 +51,26 @@ |
50 | 52 | return array( '', 'review_reject_excessive' ); |
51 | 53 | } |
52 | 54 | |
| 55 | + $contribs = SpecialPage::getTitleFor( 'Contributions' )->getPrefixedText(); |
| 56 | + |
| 57 | + $lastTextId = 0; |
53 | 58 | $rejectIds = $rejectAuthors = array(); |
54 | | - $contribs = SpecialPage::getTitleFor( 'Contributions' )->getPrefixedText(); |
55 | 59 | foreach ( $res as $row ) { |
56 | 60 | $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(); |
61 | 68 | } |
62 | 69 | $rejectAuthors = array_values( array_unique( $rejectAuthors ) ); |
63 | 70 | |
| 71 | + if ( !$rejectIds ) { // all null edits? (this shouldn't happen) |
| 72 | + return array( '', 'review_reject_nulledits' ); |
| 73 | + } |
| 74 | + |
64 | 75 | // List of revisions being undone... |
65 | 76 | $form .= wfMsgExt( 'revreview-reject-text-list', 'parseinline', |
66 | 77 | $wgLang->formatNum( count( $rejectIds ) ), $oldRev->getTitle()->getPrefixedText() ); |