Merge "Fix undo edit summary when the user who made the old revision is hidden"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sun, 30 Jun 2013 17:25:01 +0000 (17:25 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sun, 30 Jun 2013 17:25:01 +0000 (17:25 +0000)
includes/EditPage.php
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php
maintenance/language/messages.inc

index c84daa6..84bb493 100644 (file)
@@ -935,7 +935,19 @@ class EditPage {
                                                        # If we just undid one rev, use an autosummary
                                                        $firstrev = $oldrev->getNext();
                                                        if ( $firstrev && $firstrev->getId() == $undo ) {
-                                                               $undoSummary = wfMessage( 'undo-summary', $undo, $undorev->getUserText() )->inContentLanguage()->text();
+                                                               $userText = $undorev->getUserText();
+                                                               if ( $userText === '' ) {
+                                                                       $undoSummary = wfMessage(
+                                                                               'undo-summary-username-hidden',
+                                                                               $undo
+                                                                       )->inContentLanguage()->text();
+                                                               } else {
+                                                                       $undoSummary = wfMessage(
+                                                                               'undo-summary',
+                                                                               $undo,
+                                                                               $userText
+                                                                       )->inContentLanguage()->text();
+                                                               }
                                                                if ( $this->summary === '' ) {
                                                                        $this->summary = $undoSummary;
                                                                } else {
index 63f0007..668c343 100644 (file)
@@ -1592,6 +1592,7 @@ Please check the comparison below to verify that this is what you want to do, an
 'undo-failure' => 'The edit could not be undone due to conflicting intermediate edits.',
 'undo-norev'   => 'The edit could not be undone because it does not exist or was deleted.',
 'undo-summary' => 'Undo revision $1 by [[Special:Contributions/$2|$2]] ([[User talk:$2|talk]])',
+'undo-summary-username-hidden' => 'Undo revision $1 by a hidden user',
 
 # Account creation failure
 'cantcreateaccounttitle' => 'Cannot create account',
index 8a36335..c7a2bef 100644 (file)
@@ -1848,6 +1848,8 @@ See also:
 
 {{Identical|Undo}}',
 'undo-summary' => 'Edit summary for an undo action.{{Identical|Undo}}',
+'undo-summary-username-hidden' => 'Edit summary for an undo action where the username of the old revision is hidden.
+$1 is the revision ID being undone',
 
 # Account creation failure
 'cantcreateaccounttitle' => 'Used as title of the error message {{msg-mw|Cantcreateaccount-text}}.',
index 4236191..7b82276 100644 (file)
@@ -780,6 +780,7 @@ $wgMessageStructure = array(
                'undo-failure',
                'undo-norev',
                'undo-summary',
+               'undo-summary-username-hidden',
        ),
        'cantcreateaccount' => array(
                'cantcreateaccounttitle',