r84211 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84210‎ | r84211 | r84212 >
Date:22:31, 17 March 2011
Author:aaron
Status:ok
Tags:
Comment:
* (bug 27505) Use contribs links for anons in default reject summary
* Improved reject summary fallback (to short msg) code
Modified paths:
  • /trunk/extensions/FlaggedRevs/forms/RevisionReviewForm.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/forms/RevisionReviewForm.php
@@ -1044,14 +1044,15 @@
10451045 }
10461046
10471047 $rejectIds = $rejectAuthors = array();
1048 - $userNS = $wgContLang->getNsText( NS_USER );
 1048+ $contribs = SpecialPage::getTitleFor( 'Contributions' )->getPrefixedText();
10491049 foreach ( $res as $row ) {
10501050 $rev = new Revision( $row );
10511051 $rejectIds[] = $rev->getId();
10521052 $rejectAuthors[] = $rev->isDeleted( Revision::DELETED_USER )
10531053 ? wfMsg( 'rev-deleted-user' )
1054 - : "[[{$userNS}:{$rev->getUserText()}|{$rev->getUserText()}]]";
 1054+ : "[[{$contribs}/{$rev->getUserText()}|{$rev->getUserText()}]]";
10551055 }
 1056+ $rejectAuthors = array_values( array_unique( $rejectAuthors ) );
10561057
10571058 // List of revisions being undone...
10581059 $wgOut->addWikiMsg( 'revreview-reject-text-list', $wgLang->formatNum( count( $rejectIds ) ) );
@@ -1080,8 +1081,18 @@
10811082 ? wfMsg( 'rev-deleted-user' )
10821083 : $oldRev->getUserText();
10831084 // NOTE: *-cur msg wording not safe for (unlikely) edit auto-merge
1084 - $rejectAuthors = array_values( array_unique( $rejectAuthors ) );
1085 - if ( count( $rejectAuthors ) > 3 ) {
 1085+ $msg = $newRev->isCurrent()
 1086+ ? 'revreview-reject-summary-cur'
 1087+ : 'revreview-reject-summary-old';
 1088+ $defaultSummary = wfMsgExt( $msg, array( 'parsemag', 'content' ),
 1089+ $wgContLang->formatNum( count( $rejectIds ) ),
 1090+ $wgContLang->listToText( $rejectAuthors ),
 1091+ $oldRev->getId(),
 1092+ $oldRevAuthor );
 1093+ // If the message is too big, then fallback to the shorter one
 1094+ $colonSeparator = wfMsgForContent( 'colon-separator' );
 1095+ $maxLen = 255 - count( $colonSeparator ) - count( $this->comment );
 1096+ if ( strlen( $defaultSummary ) > $maxLen ) {
10861097 $msg = $newRev->isCurrent()
10871098 ? 'revreview-reject-summary-cur-short'
10881099 : 'revreview-reject-summary-old-short';
@@ -1089,20 +1100,11 @@
10901101 $wgContLang->formatNum( count( $rejectIds ) ),
10911102 $oldRev->getId(),
10921103 $oldRevAuthor );
1093 - } else {
1094 - $msg = $newRev->isCurrent()
1095 - ? 'revreview-reject-summary-cur'
1096 - : 'revreview-reject-summary-old';
1097 - $defaultSummary = wfMsgExt( $msg, array( 'parsemag', 'content' ),
1098 - $wgContLang->formatNum( count( $rejectIds ) ),
1099 - $wgContLang->listToText( $rejectAuthors ),
1100 - $oldRev->getId(),
1101 - $oldRevAuthor );
11021104 }
11031105 // Append any review comment...
11041106 if ( $this->comment != '' ) {
11051107 if ( $defaultSummary != '' ) {
1106 - $defaultSummary .= wfMsgForContent( 'colon-separator' );
 1108+ $defaultSummary .= $colonSeparator;
11071109 }
11081110 $defaultSummary .= $this->comment;
11091111 }

Status & tagging log